ElasticSearch Painless script: How to iterate in an array of Nested Objects

前端 未结 3 1084
挽巷
挽巷 2021-02-07 08:40

I am trying to create a script using the script_score of the function_score. I have several documents whose rankings field is type=\

3条回答
  •  旧巷少年郎
    2021-02-07 09:19

    Unfortunately, ElasticSearch scripting in general does not support the ability to access nested documents in this way (including Painless). Perhaps, consider a different structure to your mappings where rankings are stored in multi-valued fields if you need to be able to iterate across them in such a way. Ultimately, the nested data will need to de-normalized and put into the parent documents to be able to gets scores in the way described here.

提交回复
热议问题