How do we implement whymatch concept in elasticsearch by finding the total
number of fields in which the search term occurs and the frequency of that
search term??
If you know the fields that are contained in the document, you could
use a function_score query . For counting the number of fields a word
is contained in, you can use function_score with a boost_factor like
this:
This will add 1 to the score for each field (field1, field2,... ) that
has the term "searchterm" and the final score for each document will
be the number of fields in the document containing the term. Is this
what you want?
For getting the term frequencies, you can checkout text scoring in scripts here:
How do we implement whymatch concept in elasticsearch by finding the total
number of fields in which the search term occurs and the frequency of that
search term??
I was thinking of putting together a simple "highlighter" that just returns
if a field contains a match or not. This sounds like a nice logic
extension to that. It probably wouldn't actually be a "highlighter" but I
imagine it'd run during the highlight phase and function similarly. It'd
need something like the highlight_query, for example, to function
properly. Anyway, I believe the short answer is, if you are looking for
something specific, file an issue on github.
If you know the fields that are contained in the document, you could
use a function_score query . For counting the number of fields a word
is contained in, you can use function_score with a boost_factor like
this:
This will add 1 to the score for each field (field1, field2,... ) that
has the term "searchterm" and the final score for each document will
be the number of fields in the document containing the term. Is this
what you want?
For getting the term frequencies, you can checkout text scoring in scripts
here:
How do we implement whymatch concept in elasticsearch by finding the
total
number of fields in which the search term occurs and the frequency of
that
search term??
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
On Fri, Feb 7, 2014 at 2:36 PM, Nikolas Everett nik9000@gmail.com wrote:
I was thinking of putting together a simple "highlighter" that just returns
if a field contains a match or not. This sounds like a nice logic extension
to that. It probably wouldn't actually be a "highlighter" but I imagine
it'd run during the highlight phase and function similarly. It'd need
something like the highlight_query, for example, to function properly.
Anyway, I believe the short answer is, if you are looking for something
specific, file an issue on github.
If you know the fields that are contained in the document, you could
use a function_score query . For counting the number of fields a word
is contained in, you can use function_score with a boost_factor like
this:
This will add 1 to the score for each field (field1, field2,... ) that
has the term "searchterm" and the final score for each document will
be the number of fields in the document containing the term. Is this
what you want?
For getting the term frequencies, you can checkout text scoring in scripts
here:
How do we implement whymatch concept in elasticsearch by finding the
total
number of fields in which the search term occurs and the frequency of
that
search term??
--
You received this message because you are subscribed to the Google
Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
How do we implement whymatch concept in elasticsearch by finding the total
number of fields in which the search term occurs and the frequency of that
search term??
I wanted to extract the total number of times a search term occurs..in a
particular field..
Even if the search term is a phrase,the query should return the total
number of times that phrase
occurs and also the frequency of individual term of that phrase in each
field.
Thanks
Navneet Mathpal
On Friday, 7 February 2014 12:05:33 UTC+5:30, usha...@gmail.com wrote:
Hi,
How do we implement whymatch concept in elasticsearch by finding the total
number of fields in which the search term occurs and the frequency of that
search term??
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.