Hi David, Here is full gist:
curl -XDELETE 'http://localhost:9200/test_search' curl -XPUT 'http://localhost:9200/test_search/' -d ' { "mappings" : { "record" : { "properties" : { "object" : { "type" : "string", "index" : "not_analyzed" }, "name" : { "type" : "string" } } } } } ' curl -XPUT 'http://localhost:9200/test_search/record/1' -d '{ "object" : "User", "name" : "John Doe" }' curl -XPUT 'http://localhost:9200/test_search/record/2' -d '{ "object" : "User", "name" : "Jane Doe" }' curl -XPUT 'http://localhost:9200/test_search/record/3' -d '{ "object" : "User", "name" : "Joseph Doe" }' curl -XPUT 'http://localhost:9200/test_search/record/4' -d '{ "object" : "User", "name" : "Anna Doe" }' curl -XPUT 'http://localhost:9200/test_search/record/5' -d '{ "object" : "Venue", "name" : "Bar Luna" }' curl -XGET 'http://localhost:9200/test_search/_search?pretty=true' -d '{ "query": { "match_all": {}, "filtered": { "filter": { "term": { "object": "User" } } } }, "size" : 2 }' I've noticed that the problem exist only if under the top "query" node there are 2 elements. If I remove "match_all" or "filtered" section the size does take effect. I've combined the examples in "And Filter" + "Term Filter" to create the query, but probably this is the wrong way? Thanks On Monday, January 27, 2014 7:42:15 PM UTC, David Pilato wrote: > > Yes please. If you can gist a full curl recreation, that will help a lot! > > -- > David ;-) > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs > > > Le 27 janv. 2014 à 19:36, Nikolay Chankov <[email protected] <javascript:>> > a écrit : > > I've noticed, that the "problem" came when in the request there is a > "filtered" node. Here is the full request: > > curl-XGET 'http://localhost/search/_search' -d'{ > "query": { > "match_all": {}, > "filtered": { > "filter": { > "term": { > "object": "User" > } > } > } > }, > "size": 3, > "sort": [ > { > "name.untouched": "asc" > } > ] > }' > > So, if it's called this way the sort and size are ignored, while if they > are placed above the query, they take effect, and I can see 3 records. > if it's not correct, I would expect to get an error, rather than ignoring > the params... > > name is a multi_field with name.untouched is index not analyzed, object is > string, not analyzed. If it's still required I will try to create a full > gist tomorrow. > > > On Monday, January 27, 2014 5:54:48 PM UTC, David Pilato wrote: >> >> Can you reproduce it with a full curl recreation and gist it? >> In which version? >> >> If confirmed, could you open an issue? >> >> -- >> *David Pilato* | *Technical Advocate* | *Elasticsearch.com >> <http://Elasticsearch.com>* >> @dadoonet <https://twitter.com/dadoonet> | >> @elasticsearchfr<https://twitter.com/elasticsearchfr> >> >> >> Le 27 janvier 2014 at 18:50:32, Nikolay Chankov ([email protected]) a >> écrit: >> >> Hi guys, >> >> today I've noticed that order of the elements in the request does matter >> for example: >> >> curl -XGET 'http://localhost:9200/search/_search'-d ' >> { >> "sort" : {...}, >> "size" : 100, >> "query" : {...} >> }' >> >> is working, while >> >> curl -XGET 'http://localhost:9200/search/_search'-d ' >> { >> "query" : {...}, >> "sort" : {...}, >> "size" : 100 >> }' >> >> Doesn't take effect of size as well as on sort. >> >> I think the order shouldn't matter, and ES should reorder the elements >> internally. Am I get it wrong, or there is special reason for this? >> >> Thanks in advance. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "elasticsearch" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/c0d7791a-9c8a-40e9-855d-b6a88f2f2c87%40googlegroups.com >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/efb884a7-2e0c-4194-82b3-c4b91f5f7751%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3eebf7c1-8601-4e18-bfc3-68656da64e7b%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
