ryanhouston / elasticsearch-documents Goto Github PK
View Code? Open in Web Editor NEWA service wrapper to manage Elasticsearch index documents
License: MIT License
A service wrapper to manage Elasticsearch index documents
License: MIT License
It would be nice to have a directory with a simple set of model classes, associated Documents, and a couple Queryable classes to show a quick overview of real usage.
Client code may need to pass options in to the query such as 'size' and 'from' in order to paginate results. Queryable#execute
should take these options and merge them into the hash that ultimately gets passed through Elasticsearch::Client.search
.
Currently Queryable classes define a #to_hash
method that requires the index
and body
hash keys are present:
def to_hash
{
index: 'test_index',
body: {
query: {
query_string: {
analyzer: "snowball",
query: "something to search for"
}
}
}
}
end
The index name is already passed to the configuration so this should not be required here.
There are many options that can be passed to the elasticseach client search method. These options are also currently set in the hash provided by #as_hash
. Perhaps there is a better way to abstract the query options so #as_hash
becomes focused only on serializing the Query DSL to be assigned to the body
attribute.
Memoizing the Elasticsearch::Client instance on a module level is not threadsafe and could be an issue for multi-threaded applications.
The current specs mock and stub all actual interactions with Elasticsearch::Transport::Client
. This means we never get any real validation that the requests we are constructing are valid.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.