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

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.

What would the high value be?

Hi,

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

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

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.

Yes.
You can determine the potential for inaccuracy in a result using this: Terms Aggregation | Elasticsearch Guide [1.6] | Elastic
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.

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.

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