Filter error: facetted search where multiple terms can be selected per facet

I'm trying to filter search results based on facetted search where multiple
terms can be selected per facet. Get some errors where I need some help. Can
someone point me in de right direction?

Getting error:
No query registered for [and].

Request body and Response error: https://gist.github.com/4475755
Index mapping: https://gist.github.com/4475798

Thanks in advance!

Regards,
Kevin

--

Just wondering if your match_all is correct.
You wrote:
"match_all" :[

]

It should be
"match_all" :{}

Does it help?

Le 7 janvier 2013 à 16:40, Kevin van Cleef kevinvancleef@gmail.com a écrit :

I'm trying to filter search results based on facetted search where multiple
terms can be selected per facet. Get some errors where I need some help. Can
someone point me in de right direction?

Getting error:
No query registered for [and].

Request body and Response error: https://gist.github.com/4475755
https://gist.github.com/4475755
Index mapping: https://gist.github.com/4475798
https://gist.github.com/4475798

Thanks in advance!

Regards,
Kevin

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

Thanks David!

Op maandag 7 januari 2013 16:43:01 UTC+1 schreef David Pilato het volgende:

Just wondering if your match_all is correct.
You wrote:
"match_all" :[

]

It should be
"match_all" :{}

Does it help?

Le 7 janvier 2013 à 16:40, Kevin van Cleef <kevinv...@gmail.com<javascript:>>
a écrit :

I'm trying to filter search results based on facetted search where
multiple terms can be selected per facet. Get some errors where I need some
help. Can someone point me in de right direction?

Getting error:
No query registered for [and].

Request body and Response error: https://gist.github.com/4475755
Index mapping: https://gist.github.com/4475798

Thanks in advance!

Regards,
Kevin

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

David,

If I don't bother you..

The filters I created on field 'mime_type' and 'epoch_accessed' do not
totally function as expected.
When I selected multiple mime_types the filtering is done right, but when I
selected multiple epoch_access dates no result is returned. When I select
only one access_date it works as expected. Can you tell me how I can
accomplish this kind of filter functionality.

"filter":{

                          "and":[

                             {

                                           "range":{

                                                   "epoch_created":[

                                                           {

                                                                   "from":1339200000000,

                                                               "to":1339286400000

                                                          },

                                                          {

                                                                   "from":1343001600000,

                                                               "to":1343088000000

                                                          }

                                                   ]

                                           }

                                   },

                                  {

                                           "terms":{

                                                   "mime_type":[

                                                       "image\/jpeg",

                                                      "image\/gif"

                                                ]

                                           }

                                   }

                           ]

                   }

Regards,
Kevin

Op maandag 7 januari 2013 16:43:01 UTC+1 schreef David Pilato het volgende:

Just wondering if your match_all is correct.
You wrote:
"match_all" :[

]

It should be
"match_all" :{}

Does it help?

Le 7 janvier 2013 à 16:40, Kevin van Cleef <kevinv...@gmail.com<javascript:>>
a écrit :

I'm trying to filter search results based on facetted search where
multiple terms can be selected per facet. Get some errors where I need some
help. Can someone point me in de right direction?

Getting error:
No query registered for [and].

Request body and Response error: https://gist.github.com/4475755
Index mapping: https://gist.github.com/4475798

Thanks in advance!

Regards,
Kevin

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

After some time searching found the solution already. See below:

"filter":{
"and":[
{
"terms":{
"mime_type":[
"image/gif",
"image/jpeg"
]
}
},
{
"or":[
{
"range":{

"epoch_created":{

"from":1339200000000,

"to":1339286400000
}
}
},
{
"range":{

"epoch_created":{

"from":1341446400000,

"to":1341532800000
}
}
}
]
}
]
}

Op maandag 7 januari 2013 19:04:44 UTC+1 schreef Kevin van Cleef het
volgende:

David,

If I don't bother you..

The filters I created on field 'mime_type' and 'epoch_accessed' do not
totally function as expected.
When I selected multiple mime_types the filtering is done right, but when
I selected multiple epoch_access dates no result is returned. When I select
only one access_date it works as expected. Can you tell me how I can
accomplish this kind of filter functionality.

"filter":{

                          "and":[

                             {

                                           "range":{

                                                   "epoch_created":[

                                                           {

                                                                   "from":1339200000000,

                                                               "to":1339286400000

                                                          },

                                                          {

                                                                   "from":1343001600000,

                                                               "to":1343088000000

                                                          }

                                                   ]

                                           }

                                   },

                                  {

                                           "terms":{

                                                   "mime_type":[

                                                       "image\/jpeg",

                                                      "image\/gif"

                                                ]

                                           }

                                   }

                           ]

                   }

Regards,
Kevin

Op maandag 7 januari 2013 16:43:01 UTC+1 schreef David Pilato het volgende:

Just wondering if your match_all is correct.
You wrote:
"match_all" :[

]

It should be
"match_all" :{}

Does it help?

Le 7 janvier 2013 à 16:40, Kevin van Cleef kevinv...@gmail.com a
écrit :

I'm trying to filter search results based on facetted search where
multiple terms can be selected per facet. Get some errors where I need some
help. Can someone point me in de right direction?

Getting error:
No query registered for [and].

Request body and Response error: https://gist.github.com/4475755
Index mapping: https://gist.github.com/4475798

Thanks in advance!

Regards,
Kevin

--

--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--