Facet_filter with multiple keys and multiple values

Hello Elasticers,

I'm trying to figure out a way to perform a facet_filter with the following
semantic:

product_type:(tshirts OR jean) AND color:(red OR blue)

The problem is that it seems that the default behavior is just a big OR
between terms (product_type:tshirts OR product_type:jean OR color:red OR
color:blue).

Here's my current request json:

"facets": {
"tags": {
"terms": {
"field": "tags",
"size": 10,
"all_terms": false
},
"facet_filter": {
"terms": {
"product_type": [
"tshirts", "jean"
],
"color": [
"red", "blue"
]
}
}
}
}

Thanks by advance !

Cheers,
Jérémie

--
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 can use a bool filter as the facet filter and have explicit AND/OR
(actually must/should) clauses.

--
Ivan

On Wed, Jul 3, 2013 at 8:10 AM, Jérémie BORDIER ahfeel@gmail.com wrote:

Hello Elasticers,

I'm trying to figure out a way to perform a facet_filter with the
following semantic:

product_type:(tshirts OR jean) AND color:(red OR blue)

The problem is that it seems that the default behavior is just a big OR
between terms (product_type:tshirts OR product_type:jean OR color:red OR
color:blue).

Here's my current request json:

"facets": {
"tags": {
"terms": {
"field": "tags",
"size": 10,
"all_terms": false
},
"facet_filter": {
"terms": {
"product_type": [
"tshirts", "jean"
],
"color": [
"red", "blue"
]
}
}
}
}

Thanks by advance !

Cheers,
Jérémie

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