Query DSL: custom_filters_score allow nesting of boosts with operators #1561

Closed
apatrida opened this Issue Dec 22, 2011 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

apatrida commented Dec 22, 2011

In relevancy cases there are things like:

  • given a starting query
  • for situation A and B, multiply score by the highest of A or B producing new score
  • for situation C, D and E multiply score by the highest of those producing a new score
  • for situation F and G, discount score by the worst discount producing a new score

So you have groups of queries. Which right now you have to nest custom_filters_score to accomplish (or combine with boosts DSL for the negative and still nest queries).

In the custom_filters_score DSL would be nice to nest the filters part in groups, using the mode as the grouping. These should be grouped with operators "multiply", "max", "min", "sum" or "total", "avg"...

{
    "custom_filters_score" : {
        "query" : {
            "match_all" : {}
        },
        "filters" : {
           "multiply" : [
              {
                "max" : [
                    {
                        "filter" : { "term" : { "myfield" : "datavalue" } },
                        "boost" : 3
                    },
                    {
                        "filter" : { "term" : { "myfield_alt" : "differentvalue" } },
                        "boost" : 2
                    }
                ]
             },
             {
                "min" : [
                    {
                        "filter" : { "term" : { "danger" : "badValue" } },
                        "boost" : 0.5
                    },
                    {
                        "filter" : { "term" : { "badfield" : "horrible" } },
                        "boost" : 0.1
                    }
                 ]
             }   
          ]        
        }
    }
}
Contributor

apatrida commented Dec 22, 2011

note: nesting levels should be arbitrarily deep.

Contributor

apatrida commented Dec 22, 2011

I'm working on this one now...

Owner

clintongormley commented May 23, 2014

No progress in two years, and custom_filters_score no longer exists. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment