I am now in my third day of research on that topic. I am using ElasticSearch with Tire in my Rails app. The most important search functionality is where users can search in larger Texts (CVs of People), if the text has the right keywords in it. e.g. "Java AND Oracle" will show all texts having keyword Java and keyword Oracle in it. Everthing works fine so far.
But I am requested if the search results can return the number of hits in a document. So maybe like first result (5 times Java, 3 time Oracle), second result (7 times java, 1 time oracle), ...
Is there a possibility to display the number of matching words in a result? I couldn't find anything in the docs and even in this forum. I am sorry, when I just didn't see it. Please help!
Elasticsearch does not easily provide the number of matching words in a
result. You can turn on debugging for each query and parse the Explain
object, which should have a list of all the term frequencies matched.
It might sound like it would be more work to parse the explain object
instead of just looking at the content return yourself, but the term
frequencies in explain are after analysis, so you get a count of the query
term after synonyms, stemmers, filtering, etc...
I am not a JSON user, does JSON having something like XPath? It would be
almost trivial parsing the explain result with something like XPath.
I am now in my third day of research on that topic. I am using
Elasticsearch
with Tire in my Rails app. The most important search functionality is where
users can search in larger Texts (CVs of People), if the text has the right
keywords in it. e.g. "Java AND Oracle" will show all texts having keyword
Java and keyword Oracle in it. Everthing works fine so far.
But I am requested if the search results can return the number of hits in a
document. So maybe like first result (5 times Java, 3 time Oracle), second
result (7 times java, 1 time oracle), ...
Is there a possibility to display the number of matching words in a result?
I couldn't find anything in the docs and even in this forum. I am sorry,
when I just didn't see it. Please help!
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.