Hi everyone.

I use embedded ES node as part of java application.

Node node = nodeBuilder().clusterName("OSM-Gazetteer").node();
Client client = node.client();

I try to fetch some data paged.

SearchRequestBuilder searchQ = client.prepareSearch("gazetteer")
                .setSearchType(SearchType.QUERY_AND_FETCH)
                .setNoFields()
                .setQuery(QueryBuilders.matchAllQuery())
                .setExplain(false);
        
        searchQ.setSize(PAGE_SIZE);                //PAGE_SIZE=5;        
        searchQ.setFrom(page * PAGE_SIZE);   //page=0;

Here is the querry what I've got generated by client:

{   "from" : 0,   "size" : 5,   "query" : {     "match_all" : { }   },   
"explain" : false,   "fields" : [ ] }

curl version returns 5 hits, as expected, but java returns 20 hits:

searchQ.get().getHits().getHits().length; //=>20

Index setting are default. Hits do not have duplicates.

Is there some workaround or something?

-- 
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/647bddb1-636f-4670-9f9a-b0767001fdd8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to