Can I use AND filter for more than two queries?

I only find guide show examples than filter use AND to connect two queries.
What about more?
and => [
{
range => {
date => {
from => "2012-12-04T00:00:00",
to => "2012-12-05T23:59:59"
},
},
},
{
numeric_range => {
timeCost => {
gte => 200,
},
},
},
{
prefix => {
requestUrl => "http://img.domain.com/",
},
},
]

--

You can use a Bool Filter: http://www.elasticsearch.org/guide/reference/query-dsl/bool-filter.html

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 déc. 2012 à 03:24, chenlin rao rao.chenlin@gmail.com a écrit :

I only find guide show examples than filter use AND to connect two queries. What about more?
and => [
{
range => {
date => {
from => "2012-12-04T00:00:00",
to => "2012-12-05T23:59:59"
},
},
},
{
numeric_range => {
timeCost => {
gte => 200,
},
},
},
{
prefix => {
requestUrl => "http://img.domain.com/",
},
},
]

--

--

Also cannot write two MUST?
I found that I must write "bool":{"must":{},"must_not":{}} and then got
right result.
If I write "bool":{"must":{},"must":{}}, return all document ....

2012/12/7 David Pilato david@pilato.fr

You can use a Bool Filter:
Elasticsearch Platform — Find real-time answers at scale | Elastic

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 déc. 2012 à 03:24, chenlin rao rao.chenlin@gmail.com a écrit :

I only find guide show examples than filter use AND to connect two
queries. What about more?
and => [
{
range => {
date => {
from => "2012-12-04T00:00:00",
to => "2012-12-05T23:59:59"
},
},
},
{
numeric_range => {
timeCost => {
gte => 200,
},
},
},
{
prefix => {
requestUrl => "http://img.domain.com/",
},
},
]

--

--

--

You can write it like this.

    "must" : [
        {
            "term" : { "tag" : "wow" }
        },
        {
            "term" : { "tag" : "elasticsearch" }
        }
    ],

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 déc. 2012 à 05:17, chenlin rao rao.chenlin@gmail.com a écrit :

Also cannot write two MUST?
I found that I must write "bool":{"must":{},"must_not":{}} and then got right result.
If I write "bool":{"must":{},"must":{}}, return all document ....

2012/12/7 David Pilato david@pilato.fr
You can use a Bool Filter: Elasticsearch Platform — Find real-time answers at scale | Elastic

HTH

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 6 déc. 2012 à 03:24, chenlin rao rao.chenlin@gmail.com a écrit :

I only find guide show examples than filter use AND to connect two queries. What about more?
and => [
{
range => {
date => {
from => "2012-12-04T00:00:00",
to => "2012-12-05T23:59:59"
},
},
},
{
numeric_range => {
timeCost => {
gte => 200,
},
},
},
{
prefix => {
requestUrl => "http://img.domain.com/",
},
},
]

--

--

--

--