Code Monkey home page Code Monkey logo

elasticsearch-documents's People

Contributors

kirsten avatar ryanhouston avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bhanubhakta

elasticsearch-documents's Issues

Add Example App

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.

Allow options to be passed to Queryable#execute

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.

Simplify Queryable#to_hash required format

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.

Integration tests

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.