Time Based queries


(ElasticUser) #1

Hi,
I am new to Elastic Search and currently looking into Java API. I have
used XCOntentQueryBuilder
XContentQueryBuilder qb = termQuery("@message", someString);

In addition to the name value pair , I also need to have time
parameter passed to the query. Any suggestions on which QueryBuilder
can be used? Any comments/suggestions welcome!


(ElasticUser) #2

Any inputs on this? I need to construct a query with multiple name/
value pairs.

On Jul 28, 12:45 pm, ElasticUser lkodwa...@gmail.com wrote:

Hi,
I am new to Elastic Search and currently looking into Java API. I have
used XCOntentQueryBuilder
XContentQueryBuilder qb = termQuery("@message", someString);

In addition to the name value pair , I also need to have time
parameter passed to the query. Any suggestions on which QueryBuilder
can be used? Any comments/suggestions welcome!


(Shay Banon) #3

One option is to use the bool query to combine different queries:
http://www.elasticsearch.org/guide/reference/query-dsl/bool-query.html.

Another option is to use filtered query:
http://www.elasticsearch.org/guide/reference/query-dsl/filtered-query.htmlwith
the query you want to execute, and a filter (which can be simple ones,
like term/range/..., or compound ones like and/or).

Why you would want to use filters compared to queries is explained here:
http://www.elasticsearch.org/guide/reference/query-dsl/.

On Fri, Jul 29, 2011 at 1:11 AM, ElasticUser lkodwaney@gmail.com wrote:

Any inputs on this? I need to construct a query with multiple name/
value pairs.

On Jul 28, 12:45 pm, ElasticUser lkodwa...@gmail.com wrote:

Hi,
I am new to Elastic Search and currently looking into Java API. I have
used XCOntentQueryBuilder
XContentQueryBuilder qb = termQuery("@message", someString);

In addition to the name value pair , I also need to have time
parameter passed to the query. Any suggestions on which QueryBuilder
can be used? Any comments/suggestions welcome!


(system) #4