I'm using a a query with a collapse in order to gather hits in certain documents that belong to a certain person, yet I wish to sort the results based on the number of documents in which the search found a match..
I am not sure whether I understand your use case properly.
Collapse operation is performed on the result set that matches a certain result set to be returned. You will be needing to look at the aggregation in order to determine the top used person_id field inside your index.
What I wish to accomplish is to search all documents for a certain string and next group the documents that have a hit by their author.
In the response json I get "top_mathing_docs" which contains the number of documents found for each person, yet even after reading about aggregation, I'm not sure how to access that number in order to sort the results according to it.
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.