Search by ids and term both

Hi,

Is it possible to search by ids and term both? I tried to do something like:

curl -XGET 'http://localhost:9200/hotels/hotel/_search' -d ' { "query" : { "ids" : { "values" : [ "c900640a-12e5-4f02-8fec-07f6f4bf58ab", "56d46e68-07e8-4502-be08-df68730bae67" ] }, "term" : { "type" : "couple" } } } '
but result was:

# ERROR: Search::Elasticsearch::Error::Request [http://localhost:9200]-[400] [parse_exception] failed to parse search source. expected field name but got [START_OBJECT]

Query by ids or term only works fine

Are you essentially stating these should be an OR, or are you doing some filtering?

i try with java and it work together.
here is code i tried

 SearchResponse response =
            this.client
                .prepareSearch("hotels")
                .setQuery(
                   QueryBuilders.boolQuery().should(QueryBuilders.idsQuery("c900640a-12e5-4f02-8fec-07f6f4bf58ab"))
                        .should(QueryBuilders.termQuery("type", "couple"))).setSize(10000).execute().actionGet();

Im not sure how to code by CURL, i will try and comment if i find it later

Here is code it auto convert from java to query curl, but i think have something wrong :))

{
  "bool" : {
    "should" : [ {
      "ids" : {
        "type" : "c900640a-12e5-4f02-8fec-07f6f4bf58ab",
        "values" : [ ]
      }
    }, {
      "term" : {
        "type" : "couple"
      }
    } ]
  }
}

I need to filter by ids AND term

It looks like second 'should' call rewrites first 'should' call. I tried to do the same in perl clent, but with:

query => { bool => { should => { ids => { values => $ids }}, should => { term => { "type" => "couple" }}}}

I got:

"query" : {
      "bool" : {
         "should" : {
            "term" : {
               "type" : "couple"
            }
         }
      }
   }