Elastic has the ability to do a ranked search but I cannot see that I can store the information in the document and then return the documents based on the rank.
This an example of how I would store the information in a field (but I am open to anything) but I'm not sure if/how to query the engine to sort based on Topic A's rank.
The relevance tuning won't work since I can't make each topic a discrete field as there are 100,000's of entries.
Another way to look at what I want to do is say if I have 4 documents that discuss water quality in Lake Ontario and each of them has 'water quality' as a topic but each has a different weighted value. I want to return those documents in order of the weighted value.
I would also want to return only the documents where the weighted value is over a certain value.
In any relational DB I could do this easily so I'm thinking there has got to be a way in Elastic.
@David_Williams1 Yeah, unfortunately we don't have a great solution for nested fields like this right now.
The only way I think you'll get this working is with duplicate documents. Probably some setup where you have the same document duplicated with the various topic values.
That would let you filter by "topic" and sort by "topic_value".
You could also leverage the grouping feature when necessary to avoid duplication in results.
There's a number of drawbacks with this approach. For instance, I don't think curations will work with grouping, and the counts provided in facets when using grouping are not always what you would expect.
There's also a maintenance burden associated with this, trying to maintain multiple variations of a single document.
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.