Hi All,
I'm attempting to convert an OR filter query over to a custom_filters_score
query, as I want to boost certain combinations of results higher.
Each document has three name fields, and I want to match any document that
has a specific name in any of the fields (and boost higher if it matches
multiple name fields), but increase the boosting even more if it matches a
specific name field AND a set of address fields. I can't seem to see where
I'm making the mistake, and will admit I probably have completely missed
the mark on the query.
My attempt to re-write this query has resulted in an error, which I'll give
first - and then the query:
nested: QueryParsingException[[cases] [_na] filter malformed, no field after start_object
And, here is the query:
{
"query": {
"custom_filters_score": {
"query": {
"match_all": {
}
},
"score_mode": "multiply",
"filters": [
{
"boost": "1.2",
"filter": {
"fquery": {
"_name": "name1",
"query": {
"field": {
"name1": "John AND Doe"
}
}
}
}
},
{
"boost": "1.2",
"filter": {
"fquery": {
"_name": "name2",
"query": {
"field": {
"name2": "John AND Doe"
}
}
}
}
},
{
"boost": "1.2",
"filter": {
"and": [
{
"fquery": {
"_name": "name3",
"query": {
"field": {
"name3": "John AND Doe"
}
}
}
}
]
}
},
{
"filter": {
"boost": "1.5",
"and": [
{
"query": {
"field": {
"zip": "77001"
}
}
},
{
"query": {
"field": {
"city": "Houston"
}
}
},
{
"query": {
"field": {
"address_1": "111 AND Main AND Street"
}
}
},
{
"query": {
"field": {
"state": "TX"
}
}
},
{
"fquery": {
"_name": "name3",
"query": {
"field": {
"name3": "John AND Doe"
}
}
}
}
]
}
}
]
}
},
"size": 200
}
Note: I use fquery's as it is very important that I know which filter matched, for handling the results.
Am I completely off-base on the use of custom_filters_score here?
Thanks in advance!
--
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.
For more options, visit https://groups.google.com/groups/opt_out.