0

I have a nested field type called "authorships" (authors) that sometimes has a lot of nested objects. For example, some of the records have around 5,000 objects. Each object is fairly small. But when someone calls a set of 100 records these objects add up to cause slow performance and high memory usage. I'm using the python elasticsearch-dsl package in case it matters.

What I want to do is truncate the authors down to 100 when returned within a list of documents, but allow people to go to the individual record to see the full list of authors. I can truncate the authors after retrieving them, but it's kind of pointless because that is where the problem occurs.

Is there a way to truncate the list within a query? Maybe with a script such as painless? Do you think it would be slow when retrieving 200 records?

Casey
  • 2,611
  • 6
  • 34
  • 60

0 Answers0