Why my bool query is not working?

Hi all,

curl -XGET 'http://localhost:9200/amazon/book/_search' -d '{
"query":
{
"bool" :
{
"must" :[
{"term":{"name":"call"}},
{"range":{"pages":{"from":200,"to":300}}}
],
"must_not": [
{"term":{"book.author.first_name":"jack"}}
],
"should": [
{"term":{"book.author.last_name":"london"}}
]

                            }
                    }
}

}'

In this query i am getting SearchphaseExecutionException....

Regards,
Sumit Gupta

Hi Sumit,

I don't know if that's it, but you have an extra "}" in the end.

On Apr 11, 1:31 pm, Sumit Guptaa sumit.gupta....@gmail.com wrote:

Hi all,

curl -XGET 'http://localhost:9200/amazon/book/_search'-d '{
"query":
{
"bool" :
{
"must" :[
{"term":{"name":"call"}},

{"range":{"pages":{"from":200,"to":300}}}
],
"must_not": [

{"term":{"book.author.first_name":"jack"}}
],
"should": [

{"term":{"book.author.last_name":"london"}}
]

                            }
                    }
}

}'

In this query i am getting SearchphaseExecutionException....

Regards,
Sumit Gupta

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/why-my-bool-query-is-...
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Hi Radhu,

auxuly this is not the adject reason because i check it many time...so please give me adject reason...

thanx..

Rgds,
Sumit Gupta

Hi Sumit,

I don't know at this point, really. I've tried that query and I didn't
get any exception.

Can you post here some more details on your setup? Mapping,
configuration...

On Apr 12, 10:38 am, Sumit Guptaa sumit.gupta....@gmail.com wrote:

Hi Radhu,

auxuly this is not the adject reason because i check it many time...so
please give me adject reason...

thanx..

Rgds,
Sumit Gupta

--
View this message in context:http://elasticsearch-users.115913.n3.nabble.com/why-my-bool-query-is-...
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

Salut Radu,
Can you please help me?
I have a jdbc river installed in my elasticsearch-0.20.3.

And the following mapping:

{
"mappings":{
"car" : {
"properties" : {
"engineType" : {"type" : "string", "index" : "not_analyzed"},
"price" : {"type" : "integer"},
"mileage" : {"type" : "integer"},
}
}
},
"settings":{
"analysis":{
"filter":{
"snowball": {
"type": "snowball",
"language": "French"
}
},
"analyzer":{
"my_analyzer":{
"filter":[
"standard",
"lowercase",
"asciifolding"
],
"type":"custom",
"tokenizer":"standard"
}
}
}
}
}

I'm trying to fetch all the cars that has bellow 10000 Km as mileage with a
bool query and a range fecet:

{
"query": {
"bool": {
"must": {
"range": {
"mileAge": {
"from": "1",
"to": "10000"
}
}
}
}
}
}

But infortunatelly it does'nt find any documents the result is: {

  • took: 5
  • timed_out: false
  • _shards: {
    • total: 6
    • successful: 6
    • failed: 0
      }
  • hits: {
    • total: 0
    • max_score: null
    • hits: [ ]
      }

}
Can you please provide a hint regarding what is wrong?

Multam fain,
Gabriel

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

Salut Gabriel! :slight_smile:

The problem might come from writing "mileAge" instead of "mileage" in the
query. It's case-sensitive.

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Fri, Feb 1, 2013 at 1:15 PM, Gabriel Mirea gmirea@sqli.com wrote:

Salut Radu,
Can you please help me?
I have a jdbc river installed in my elasticsearch-0.20.3.

And the following mapping:

{
"mappings":{
"car" : {
"properties" : {
"engineType" : {"type" : "string", "index" : "not_analyzed"},
"price" : {"type" : "integer"},
"mileage" : {"type" : "integer"},
}
}
},
"settings":{
"analysis":{
"filter":{
"snowball": {
"type": "snowball",
"language": "French"
}
},
"analyzer":{
"my_analyzer":{
"filter":[
"standard",
"lowercase",
"asciifolding"
],
"type":"custom",
"tokenizer":"standard"
}
}
}
}
}

I'm trying to fetch all the cars that has bellow 10000 Km as mileage with
a bool query and a range fecet:

{
"query": {
"bool": {
"must": {
"range": {
"mileAge": {
"from": "1",
"to": "10000"
}
}
}
}
}
}

But infortunatelly it does'nt find any documents the result is: {

  • took: 5
  • timed_out: false
  • _shards: {
    • total: 6
    • successful: 6
    • failed: 0
      }
  • hits: {
    • total: 0
    • max_score: null
    • hits: [ ]
      }

}
Can you please provide a hint regarding what is wrong?

Multam fain,
Gabriel

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