Each one of my documents within my index contains values associated with sales data and I calculate a score for each document based on those values. Currently, the values are bucketed globally, meaning that before indexing these values we bucketize the entire set and index them into ES. I'd like to bucket these values at the query level and then calculate the document scores. Is it possible to use aggregation values within the script score functionality? Are there better ways of achieving a similar outcome?
this is not possible as aggregation calculation happens at a very different level than the score calculation. I'm still not super sure about the use-case, but it seems that reindexing/updating your data based on your queries sounds like a plan in this use-case, as the scores seem to change with the data being indexed, this cannot be done at index time.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.