Filtered Query

hi all,

I am trying to add a filter to the following query:

{
"query": {
"query_string": {
"query": Q
,"minimum_should_match": "3"
}
}
,"facets": {
"tags": {
"terms": {
"field": "tags"
}
}
}
}

I tried different variation, among which the one below, but I can't get
it to work:

{
"query": {
"filtered": {

         "query":  {
              "query_string": {
                    "query": Q
                  ,"minimum_should_match": "3"
             }
         }
         ,"filter": {
              "and" : [
                 { "tags": "red" }
              ]
         }
         ,"facets": {
              "tags": {
                  "terms": {
                     "field": "tags"
                 }
             }
         }
      }
 }

}

any ideas what I am doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

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

Try this :

{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "Q",
"minimum_should_match": "3"
}
},
"filter": {
"and": [
{
"term": {
"tags": "red"
}
}
]
}
}
}
,"facets": {
"tags": {
"terms": {
"field": "tags"
}
}
}
}

On Friday, 9 August 2013 10:35:44 UTC+5:30, Igal wrote:

hi all,

I am trying to add a filter to the following query:

{
"query": {
"query_string": {
"query": Q
,"minimum_should_match": "3"
}
}
,"facets": {
"tags": {
"terms": {
"field": "tags"
}
}
}
}

I tried different variation, among which the one below, but I can't get
it to work:

{
"query": {
"filtered": {

         "query":  { 
              "query_string": { 
                    "query": Q 
                  ,"minimum_should_match": "3" 
             } 
         } 
         ,"filter": { 
              "and" : [ 
                 { "tags": "red" } 
              ] 
         } 
         ,"facets": { 
              "tags": { 
                  "terms": { 
                     "field": "tags" 
                 } 
             } 
         } 
      } 
 } 

}

any ideas what I am doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

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

no one?

On 8/8/2013 10:05 PM, Igal @ getRailo.org wrote:

hi all,

I am trying to add a filter to the following query:

{
"query": {
"query_string": {
"query": Q
,"minimum_should_match": "3"
}
}
,"facets": {
"tags": {
"terms": {
"field": "tags"
}
}
}
}

I tried different variation, among which the one below, but I can't
get it to work:

{
"query": {
"filtered": {

        "query":  {
             "query_string": {
                   "query": Q
                 ,"minimum_should_match": "3"
            }
        }
        ,"filter": {
             "and" : [
                { "tags": "red" }
             ]
        }
        ,"facets": {
             "tags": {
                 "terms": {
                    "field": "tags"
                }
            }
        }
     }
}

}

any ideas what I am doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

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

A full curl recreation on gist.github.com could help us to better understand your concern and provide a solution.

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

Le 13 août 2013 à 18:55, "Igal @ getRailo.org" igal@getrailo.org a écrit :

no one?

On 8/8/2013 10:05 PM, Igal @ getRailo.org wrote:

hi all,

I am trying to add a filter to the following query:

{
"query": {
"query_string": {
"query": Q
,"minimum_should_match": "3"
}
}
,"facets": {
"tags": {
"terms": {
"field": "tags"
}
}
}
}

I tried different variation, among which the one below, but I can't get it to work:

{
"query": {
"filtered": {

       "query":  {
            "query_string": {
                  "query": Q
                ,"minimum_should_match": "3"
           }
       }
       ,"filter": {
            "and" : [
               { "tags": "red" }
            ]
       }
       ,"facets": {
            "tags": {
                "terms": {
                   "field": "tags"
               }
           }
       }
    }

}
}

any ideas what I am doing wrong?

TIA,

Igal

--
Igal Sapir
Railo Core Developer
http://getRailo.org/

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