Hi all,

We'd like to combine the query score with our own custom trending score for 
a given document. Currently, our query looks like:

{
    "query": {
        "filtered": {
            "filter": {
                "and": [
                    {
                        "range": {
                            "trendingScore": {
                                "gt": 0.0
                            }
                        }
                    }
                ]
            }, 
            "query": {
                "function_score": {
                    "functions": [
                        {
                            "field_value_factor": {
                                "field": "trendingScore"
                            }
                        }
                    ], 
                    "query": {
                        "bool": {
                            "minimum_should_match": 1, 
                            "should": [
                                {
                                    "match_phrase": {
                                        "title": {
                                            "boost": 1.5, 
                                            "query": "<phrase>"
                                        }
                                    }
                                }, 
                                {
                                    "match_phrase": {
                                        "content": {
                                            "boost": 1.0, 
                                            "query": "<phrase>"
                                        }
                                    }
                                }
                            ]
                        }
                    }
                }
            }
        }
    }
}

So, this query seems to do want we want: it multiples the query score for 
document with our custom trending score (stored on the "trendingScore" 
field). The problem is that the trending score, in many cases, overwhelms 
the query score. Thus, documents with very low relevancy, but very high 
trending, are at the top of our results. Ideally, we'd filter the query to 
only return the top N percentage of documents that matched, but I don't 
think that's possible. We've looked at the min_score parameter for queries 
as well, but I don't know what a "good" value would be for this. 

Does anyone have any ideas on the best way to solve this problem? Thank you 
ahead of time!

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/7bc5f7ed-4021-4044-bde0-a9e0f538e213%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to