2021年1月5日星期二

Elastic Search - what difference between from/size and partition in pagination?

I have a scenario that I want to search all records from a filter. For Ex:

  1. There is a index named brands (fields: brand_name, year).
  2. The brand can be appear at many year ( Brand: A , at year: 2009, 2010, 2012 ...)

Requirement: get brands in range of years. the result is over 100.000 for any ranges. Question: Can I retrieve it all by:

  1. Looping on each query that has from/size (pagination)
  2. Looping on each query that has partition in aggregations
...  aggs: {      brands: {          terms: {              field: 'brand_name',              include: {                  partition: indexOfPartition,                  num_partitions: numOfPartitions,              },          },          size: 10000,      }  }  ...  

What diference between them. Please advise.

Note: I editted the title to make clear the purpose of this post.

https://stackoverflow.com/questions/65573304/elastic-search-what-difference-between-from-size-and-partition-in-pagination January 05, 2021 at 12:32PM

没有评论:

发表评论