ElasticSearch 1.1.0 equivalent to field query filter


(dark_shadow) #1

Hi,

I recently migrated from ES 0.90.3 to ES 1.1.0 but facing few issues while
migration.

  1. I was earlier using a field query filter based on the value of a field
    which is present in my document. Now, in ES 1.1.0 there is no such filter.
    Can anyone tell me what equivalent filter can be used. For eg, let's say I
    have a boolean field FIELD in my document and I want to put a filter based
    on the value of documents. So, I want only those documents for which this
    is TRUE. How can I achieve this in ES 1.1.0.

  2. I searched on forums about this issue. At one place I found field query
    is effectively same as query_string. I'm not getting this concept
    completely. Can anyone please explain this with some example.

  3. Also, I'm exploring what all features are added in this new version but
    not able to find any proper java documentation. I found one link but that
    also is not complete. Any pointer to good links. Let's say I want to
    explore some particular query like function score, how can I find what all
    methods are there equivalent to query dsl in java implementation.

Thanks

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #2

The field query is basically the query string query with the field
explicitly defined:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-field-query.html

The best resources for the Java API is to look at the unit tests and the
equivalent REST API classes. For example, RestSearchAction,
RestIndexAction, RestClusterHealthAction, etc.

Cheers,

Ivan

On Wed, May 21, 2014 at 10:46 AM, coder mukulnitkkr@gmail.com wrote:

Hi,

I recently migrated from ES 0.90.3 to ES 1.1.0 but facing few issues while
migration.

  1. I was earlier using a field query filter based on the value of a field
    which is present in my document. Now, in ES 1.1.0 there is no such filter.
    Can anyone tell me what equivalent filter can be used. For eg, let's say I
    have a boolean field FIELD in my document and I want to put a filter based
    on the value of documents. So, I want only those documents for which this
    is TRUE. How can I achieve this in ES 1.1.0.

  2. I searched on forums about this issue. At one place I found field query
    is effectively same as query_string. I'm not getting this concept
    completely. Can anyone please explain this with some example.

  3. Also, I'm exploring what all features are added in this new version but
    not able to find any proper java documentation. I found one link but that
    also is not complete. Any pointer to good links. Let's say I want to
    explore some particular query like function score, how can I find what all
    methods are there equivalent to query dsl in java implementation.

Thanks

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCXGAOD95fuPubBSL3_o%2BMoEZsNcfW_Buve1gXfwfqb-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(dark_shadow) #3

Just one confusion. let's say I want to query for a field which contains
boolean value either true or false. So, writing query string with field =
"true" won't search for that particular documents containing true for that
boolean field. How can I achive this ? String "true" is different from
boolean true, right ?

On Thursday, 22 May 2014 03:57:05 UTC+5:30, Ivan Brusic wrote:

The field query is basically the query string query with the field
explicitly defined:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-field-query.html

The best resources for the Java API is to look at the unit tests and the
equivalent REST API classes. For example, RestSearchAction,
RestIndexAction, RestClusterHealthAction, etc.

Cheers,

Ivan

On Wed, May 21, 2014 at 10:46 AM, coder <mukul...@gmail.com <javascript:>>wrote:

Hi,

I recently migrated from ES 0.90.3 to ES 1.1.0 but facing few issues
while migration.

  1. I was earlier using a field query filter based on the value of a field
    which is present in my document. Now, in ES 1.1.0 there is no such filter.
    Can anyone tell me what equivalent filter can be used. For eg, let's say I
    have a boolean field FIELD in my document and I want to put a filter based
    on the value of documents. So, I want only those documents for which this
    is TRUE. How can I achieve this in ES 1.1.0.

  2. I searched on forums about this issue. At one place I found field
    query is effectively same as query_string. I'm not getting this concept
    completely. Can anyone please explain this with some example.

  3. Also, I'm exploring what all features are added in this new version
    but not able to find any proper java documentation. I found one link but
    that also is not complete. Any pointer to good links. Let's say I want to
    explore some particular query like function score, how can I find what all
    methods are there equivalent to query dsl in java implementation.

Thanks

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1d9c60b9-5504-4171-a2c2-87f0c816828f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #4

Why not use a term query/filter? Boolean fields are not analyzed, so a term
query would be the best path.

If you are not using the Lucene query syntax, the match query would also be
preferable. I do not use string values to represent boolean/numeric
entities.

--
Ivan

On Wed, May 21, 2014 at 8:12 PM, coder mukulnitkkr@gmail.com wrote:

Just one confusion. let's say I want to query for a field which contains
boolean value either true or false. So, writing query string with field =
"true" won't search for that particular documents containing true for that
boolean field. How can I achive this ? String "true" is different from
boolean true, right ?

On Thursday, 22 May 2014 03:57:05 UTC+5:30, Ivan Brusic wrote:

The field query is basically the query string query with the field
explicitly defined:

http://www.elasticsearch.org/guide/en/elasticsearch/
reference/0.90/query-dsl-field-query.html

The best resources for the Java API is to look at the unit tests and the
equivalent REST API classes. For example, RestSearchAction,
RestIndexAction, RestClusterHealthAction, etc.

Cheers,

Ivan

On Wed, May 21, 2014 at 10:46 AM, coder mukul...@gmail.com wrote:

Hi,

I recently migrated from ES 0.90.3 to ES 1.1.0 but facing few issues
while migration.

  1. I was earlier using a field query filter based on the value of a
    field which is present in my document. Now, in ES 1.1.0 there is no such
    filter. Can anyone tell me what equivalent filter can be used. For eg,
    let's say I have a boolean field FIELD in my document and I want to put a
    filter based on the value of documents. So, I want only those documents for
    which this is TRUE. How can I achieve this in ES 1.1.0.

  2. I searched on forums about this issue. At one place I found field
    query is effectively same as query_string. I'm not getting this concept
    completely. Can anyone please explain this with some example.

  3. Also, I'm exploring what all features are added in this new version
    but not able to find any proper java documentation. I found one link but
    that also is not complete. Any pointer to good links. Let's say I want to
    explore some particular query like function score, how can I find what all
    methods are there equivalent to query dsl in java implementation.

Thanks

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%
40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1d9c60b9-5504-4171-a2c2-87f0c816828f%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/1d9c60b9-5504-4171-a2c2-87f0c816828f%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBCSsaoFXxzZLRyZ3Zmq2vg_0-Tmhe8igDw2Hhz1p9bZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(dark_shadow) #5

Actually, I tried using the term filter but it doesn't work when the field
on which it is applied is not present in all the documents. It works fine
if the field is present in all the documents.

Thanks,

On Thu, May 22, 2014 at 10:33 PM, Ivan Brusic ivan@brusic.com wrote:

Why not use a term query/filter? Boolean fields are not analyzed, so a
term query would be the best path.

If you are not using the Lucene query syntax, the match query would also
be preferable. I do not use string values to represent boolean/numeric
entities.

--
Ivan

On Wed, May 21, 2014 at 8:12 PM, coder mukulnitkkr@gmail.com wrote:

Just one confusion. let's say I want to query for a field which contains
boolean value either true or false. So, writing query string with field =
"true" won't search for that particular documents containing true for that
boolean field. How can I achive this ? String "true" is different from
boolean true, right ?

On Thursday, 22 May 2014 03:57:05 UTC+5:30, Ivan Brusic wrote:

The field query is basically the query string query with the field
explicitly defined:

http://www.elasticsearch.org/guide/en/elasticsearch/
reference/0.90/query-dsl-field-query.html

The best resources for the Java API is to look at the unit tests and the
equivalent REST API classes. For example, RestSearchAction,
RestIndexAction, RestClusterHealthAction, etc.

Cheers,

Ivan

On Wed, May 21, 2014 at 10:46 AM, coder mukul...@gmail.com wrote:

Hi,

I recently migrated from ES 0.90.3 to ES 1.1.0 but facing few issues
while migration.

  1. I was earlier using a field query filter based on the value of a
    field which is present in my document. Now, in ES 1.1.0 there is no such
    filter. Can anyone tell me what equivalent filter can be used. For eg,
    let's say I have a boolean field FIELD in my document and I want to put a
    filter based on the value of documents. So, I want only those documents for
    which this is TRUE. How can I achieve this in ES 1.1.0.

  2. I searched on forums about this issue. At one place I found field
    query is effectively same as query_string. I'm not getting this concept
    completely. Can anyone please explain this with some example.

  3. Also, I'm exploring what all features are added in this new version
    but not able to find any proper java documentation. I found one link but
    that also is not complete. Any pointer to good links. Let's say I want to
    explore some particular query like function score, how can I find what all
    methods are there equivalent to query dsl in java implementation.

Thanks

--
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 elasticsearc...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%
40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1d9c60b9-5504-4171-a2c2-87f0c816828f%40googlegroups.comhttps://groups.google.com/d/msgid/elasticsearch/1d9c60b9-5504-4171-a2c2-87f0c816828f%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBCSsaoFXxzZLRyZ3Zmq2vg_0-Tmhe8igDw2Hhz1p9bZw%40mail.gmail.comhttps://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBCSsaoFXxzZLRyZ3Zmq2vg_0-Tmhe8igDw2Hhz1p9bZw%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAAVTvp6y9Axc0z2n6%2Bm0H%2BC7n6RdamNSrrzZfepcjOp_V4N8Fw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #6