angelf / escargot

ElasticSearch connector for Rails - Abandoned!
MIT License
61 stars 20 forks source link

Treat query_dsl as part of options rather than query #14

Closed rubish closed 13 years ago

rubish commented 13 years ago

Queries written with query_dsl => false should also use options. The current implementation doesn't allow them. That is, when I do

User.search :sort => [{:weight => "desc"}], 
                   :query => {:match_all => {}},
                   :query_dsl => false,
                   :per_page => 10,
                   :page => 1

even though per_page and page are treated as part of query and are passed to ES resulting in a failing query, however they are options passed to escargot and should not be passed down to elastic search.

PS: there is a failing test, which was failing before I did my changes. I think it should pass, but I am not sure why it is failing.

1) Failure:
test_not_analyzed_property(Mappings) [./test/mappings_test.rb:30]:
<1> expected but was
<0>.
rubish commented 13 years ago

Accidently added activerecord commit to this one. Was trying to remove the commit from pull request but instead created a pull request. Closing this one in favor of #15