Hello,
I'm using Elastica, a PHP implementation of Elastic Search, and I was told
something could not be done in Elastica because it can not be done with
Elastic Search and I am just checking if it really can not be done with
Elastic Search.
Right now, if a query is found in a document that counts as one result. If
the query is found in another document that counts as one result.
Is there a way I can get the results to match the number of times a query
is in the document instead of one result per document.
Like a browser's ctrl / cmd + f functionality returns 3 if the query is
found 3 times in a document.
You could potentially enabled explain on the query, then for each document
you can extract the term frequency of the term from the explain object.
Term frequencies need to be enabled on the field. You might encounter
issues depending on how the text is analyzed, especially if you apply
stemming.
--
Ivan
On Tue, Apr 9, 2013 at 10:29 AM, irfan mir theirf@gmail.com wrote:
Hello,
I'm using Elastica, a PHP implementation of Elastic Search, and I was told
something could not be done in Elastica because it can not be done with
Elastic Search and I am just checking if it really can not be done with
Elastic Search.
Right now, if a query is found in a document that counts as one result. If
the query is found in another document that counts as one result.
Is there a way I can get the results to match the number of times a query
is in the document instead of one result per document.
Like a browser's ctrl / cmd + f functionality returns 3 if the query is
found 3 times in a 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.