Now if we index several documents in this mapping, and then do a query
across all fields (like a free text query):
{
"query": {
"query_string": {
"query": "A*"
}
}
Now each hit in this query would match against some field in a given
document (say it matches first_name on 50 occasions, last_name on 30
occasions, address on 60 occasions).
Is there a way in ES where I could get the above kind of result set ? Can
you achieve something like this using facets?
I was not able to figure out a way to return the count on field matches.
Any help would be appreciated.
AFAIK, the only way to get this information is to parse the score
explanation yourself to see which fields were used in the scoring. Each hit
contains its own explanation. Of course, since you have to parse the data
yourself, then you can only aggregate stats on the top k documents.
Now if we index several documents in this mapping, and then do a query
across all fields (like a free text query):
{
"query": {
"query_string": {
"query": "A*"
}
}
Now each hit in this query would match against some field in a given
document (say it matches first_name on 50 occasions, last_name on 30
occasions, address on 60 occasions).
Is there a way in ES where I could get the above kind of result set ? Can
you achieve something like this using facets?
I was not able to figure out a way to return the count on field matches.
Any help would be appreciated.
Thanks for your inputs Ivan.I did figure out a way.Kind of a hack
though.You could request a facet query/filter for each field in the
request.Something like:
Now if we index several documents in this mapping, and then do a query
across all fields (like a free text query):
{
"query": {
"query_string": {
"query": "A*"
}
}
Now each hit in this query would match against some field in a given
document (say it matches first_name on 50 occasions, last_name on 30
occasions, address on 60 occasions).
Is there a way in ES where I could get the above kind of result set ? Can
you achieve something like this using facets?
I was not able to figure out a way to return the count on field matches.
Any help would be appreciated.
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.