Boost a particular es type

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost a particular es type

Krishna Kumar Perumalla
query on "com" and "att" elasticsearch types.

I want to boost based on elasticsearch type. If the type is "com", I'd like a boost in the score of results from that type. Is it possible? If yes, how?

Query:
{
    "query": {
        "bool": {
            "should": [
                {
                    "match": {
                        "verbose": qString
                    }
                },
                {
                    "match_phrase_prefix": {
                        "verbose": {
                            "query": qString
                        }
                    }
                }
            ]
        }
    },
    "from": offset,
    "size": count,
    "filter": {
        "terms": {
            "project_id": project_ids
        }
    }
};

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Boost a particular es type

Krishna Kumar Perumalla
Oops.. Ignore this one!

Got my answer with https://gist.github.com/kimchy/1296774

/Krishna

On Monday, October 21, 2013 8:53:48 PM UTC+5:30, Krishna Kumar Perumalla wrote:
query on "com" and "att" elasticsearch types.

I want to boost based on elasticsearch type. If the type is "com", I'd like a boost in the score of results from that type. Is it possible? If yes, how?

Query:
{
    "query": {
        "bool": {
            "should": [
                {
                    "match": {
                        "verbose": qString
                    }
                },
                {
                    "match_phrase_prefix": {
                        "verbose": {
                            "query": qString
                        }
                    }
                }
            ]
        }
    },
    "from": offset,
    "size": count,
    "filter": {
        "terms": {
            "project_id": project_ids
        }
    }
};

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.