ElasticSearch 1.1.0 equivalent to field query filter

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ElasticSearch 1.1.0 equivalent to field query filter

dark_shadow
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: ElasticSearch 1.1.0 equivalent to field query filter

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


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 <[hidden email]> 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 [hidden email].
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.

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: ElasticSearch 1.1.0 equivalent to field query filter

dark_shadow
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:

<a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-field-query.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2F0.90%2Fquery-dsl-field-query.html\46sa\75D\46sntz\0751\46usg\75AFQjCNE1BxKSreWDNOEzYQhqYph5VI-o7Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2F0.90%2Fquery-dsl-field-query.html\46sa\75D\46sntz\0751\46usg\75AFQjCNE1BxKSreWDNOEzYQhqYph5VI-o7Q';return true;">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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="r47HNcKIwIMJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">mukul...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="r47HNcKIwIMJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/b789f3ed-645e-4dc0-ac98-d5b329c7b845%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: ElasticSearch 1.1.0 equivalent to field query filter

Ivan Brusic
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 <[hidden email]> 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:


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 <[hidden email]> 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.

--
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 [hidden email].
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.

--
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: ElasticSearch 1.1.0 equivalent to field query filter

dark_shadow
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 <[hidden email]> 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 <[hidden email]> 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:


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 <[hidden email]> 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.

--
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 [hidden email].
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.

--
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 [hidden email].
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.

--
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 [hidden email].
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.