ES term suggestion: Results is difference when "size" change

(Duong Quang Duc) #1

Hi all,

I'm using ES 1.6 and I faced an issue with term suggestion recently :

a. When I set "size" to 8, I got suggestions like "1, 2, 3, 4, 5, 6, 7, 8"
b. When I set "size" to 10 or bigger, I got suggestions like "1, 3, 2, 4, 7, 6, 9, 10"

The results in both cases is correct but the order is difference, and in some case the results of (b) don't contains the results of (a)

Is it because of the way ES travel through shards ?
I tried "preference" option but seem not worked for suggestion.
I also set "shard_size" to a high value but seem affect performance and not a complete solution ?

I want to keep the same order when "size" increase, do you have any suggestions or idea on this ?
Thanks a lot.

(Mark Harwood) #2

What would the high value be?

(Duong Quang Duc) #3


It's x100 in my case, so for size=10 I'll set shard_size to 1000

(Mark Harwood) #4

Hmm. And what was the performance difference? Do you have other aggregations nested under these terms too?

(Duong Quang Duc) #5

It's slower not much, still good (~10% slower) but not cover all the case (so I'm trying other values). I dont have aggs nested too.

In general, "shard_size" is the solution ? It's because I think increase it too much will affect performance, so I'm finding some workarounds.

(Mark Harwood) #6

You can determine the potential for inaccuracy in a result using this:
If you decide you want 100% accurate doc_counts for the top terms returned you can always make a second request passing them in a terms query to narrow the scope of things you are aggregating.

(Duong Quang Duc) #7

Wait a bit, are we discussing on suggestion (completion) in ES ?
I faced that problem when using suggestion and try to return same results when "size" parameter increased.
BTW the issue seem similar to your case.

(system) #8

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