Getting fixed number of results using multi search API


(radhe) #1

Is it possible to get fixed number of results from each index searched? For example if it1, it2 and it3 are three different indexes and I want 6 results from it1, 4 results from it2 and 5 from it3. And I want only these 15 results to be send back to requested source in JSON object document.
I'm using multi search API with context suggester as:

GET _msearch
{"index":"it1","type":"_doc"}
{"suggest":{"suggestion":{"prefix":"ekt","completion":{"field":"suggest","fuzzy":{"fuzziness":2}}}}}
{"index":"it2","type":"_doc"}
{"suggest":{"suggestion":{"prefix":"ekt","completion":{"field":"suggest","fuzzy":{"fuzziness":2}}}}}
{"index":"it3","type":"_doc"}
{"suggest":{"suggestion":{"prefix":"ekt","completion":{"field":"suggest","fuzzy":{"fuzziness":2}}}}}


(radhe) #2

@dadoonet Sir?


(David Pilato) #3

Read this and specifically the "Also be patient" part.

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

Also don't ping people who are not yet part of the discussion.


(David Pilato) #4

Multi Search API allows you to pass multiple search requests.

A search request can set the size parameter, so I guess you can add this to every request?


(radhe) #5

Is default size value is 5?


(David Pilato) #6

No. It's 10.


(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.