Help with terminate_after returns more results than must

Hi All!

I have strange result when make my query request - on local all ok and works like expected, but on AWS haves issue - i set

terminate_after

but it not works like expected, see attached screen.

data = response['hits']['hits']

params = elasticsearch query

any ideas why this give me 5 results insteed 1 ??

Thanks!

terminate_after is per shard. My guess is that locally you're querying an index with 1 shard, while on AWS you're querying an index with 5 shards.

m.... so main issue in indexing process? any ideas what parameter i need set (on idex or in search and what exact)?

When you create an index, you can provide a body with settings. One of those settings is number_of_shards. Prior to version 7, this defaulted to 5. As of version 7 now, this defaults to 1. Maybe that's what you're seeing?

What is it you're trying to achieve exactly? If you only want to see one hit, you can use the size parameter instead of terminate_after.

1 Like

thank! you help me again! ))

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