Its possible to give a different boost to queries in an OR condition filter?

I have the next query with gets my all what could possible match with what
a user types on a text, what i need to do is to add a boost to a query
inside an OR condition, i need to rank higher the documents that are of a
certain type.
Wich will be the best approach to do this????

{
"filter": {
"term": {
"status": 1
}
},
"from": 0,
"size": 8,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "grid~"
}
},
"filter": {
"and": [
{
"or": [
{
"geo_distance": {
"distance": "75mi",
"field_point:latlon":
"47.6062095,-122.3320708"
}
},
{
"missing": {
"field": "field_point:latlon",
"existence": true,
"null_value": true
}
}
]
},
{
"or": [
{
"query": {
"query_string": {
"query": "(field_state:ALL OR
field_state:'WA') AND type:incentive"

  •   "I need to give a high rank to this query over the other on this OR 
    

"*
}
}
},
{
"query": {
"query_string": {
"query": "* AND NOT
(type:adcampaign OR type:incentive OR type:page_simple OR type:page OR
type:glossary_item OR type:product OR type:lighting_option)"
}
}
}
]
},
{
"query": {
"query_string": {
"query": "status:1"
}
}
}
]
}
}
},
"facets": {
"type": {
"terms": {
"field": "type",
"size": 100
}
},
"field_energy_advisor": {
"terms": {
"field": "field_energy_advisor",
"size": 100
}
}
}
}

--
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.

You need to change your filter to be a query in order to influence score
with filtered. Once it's a query you can simply boost it.
Filters only "filter" while queries also score.

simon

On Friday, August 9, 2013 6:16:14 PM UTC+2, Alfonso Noguez wrote:

I have the next query with gets my all what could possible match with what
a user types on a text, what i need to do is to add a boost to a query
inside an OR condition, i need to rank higher the documents that are of a
certain type.
Wich will be the best approach to do this????

{
"filter": {
"term": {
"status": 1
}
},
"from": 0,
"size": 8,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "grid~"
}
},
"filter": {
"and": [
{
"or": [
{
"geo_distance": {
"distance": "75mi",
"field_point:latlon":
"47.6062095,-122.3320708"
}
},
{
"missing": {
"field": "field_point:latlon",
"existence": true,
"null_value": true
}
}
]
},
{
"or": [
{
"query": {
"query_string": {
"query": "(field_state:ALL OR
field_state:'WA') AND type:incentive"

  •   "I need to give a high rank to this query over the other on this 
    

OR "*
}
}
},
{
"query": {
"query_string": {
"query": "* AND NOT
(type:adcampaign OR type:incentive OR type:page_simple OR type:page OR
type:glossary_item OR type:product OR type:lighting_option)"
}
}
}
]
},
{
"query": {
"query_string": {
"query": "status:1"
}
}
}
]
}
}
},
"facets": {
"type": {
"terms": {
"field": "type",
"size": 100
}
},
"field_energy_advisor": {
"terms": {
"field": "field_energy_advisor",
"size": 100
}
}
}
}

--
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.