Java API Query for _all field in match:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Java API Query for _all field in match:

Anusha
Hi,

Am using a query :

GET ymme/ymmetype/_search
{
    "size": 20,
    "query": {
       "match": {
           "_all":
           {
               "query": "2000/sun ",
               "operator": "and"
           }
       }
    }
}

I would like to use the relevant query using Java API using query builders,

Can anyone post the Java API code to the above query....

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/
---
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/e85e326f-efb9-4965-8498-6c6d48c3a44d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Java API Query for _all field in match:

Jason Wee
query = filteredQuery(QueryBuilders.queryString("2000/sun").defaultOperator("and"), null);
                
response = client.prepareSearch(yemme).setTypes(ymmetype).setQuery(query).setSize(20).execute().actionGet();
                        
in query string, you might want to escape the slash as it means something like the regex usage.

es has moved to https://discuss.elastic.co/ , you should post your question there.

hth

jason


On Thursday, June 4, 2015 at 3:32:54 PM UTC+8, Muddadi Hemaanusha wrote:
Hi,

Am using a query :

GET ymme/ymmetype/_search
{
    "size": 20,
    "query": {
       "match": {
           "_all":
           {
               "query": "2000/sun ",
               "operator": "and"
           }
       }
    }
}

I would like to use the relevant query using Java API using query builders,

Can anyone post the Java API code to the above query....

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/
---
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/ab1431c1-0fe9-4fa2-b57b-c1ee9a414042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Java API Query for _all field in match:

Anusha
Hi Jason,

Thanks for your response , but I would like to build the query using matchQuery and I have done even settings with different analyzers and filters, I got the relevant query of Java API.

BoolQueryBuilder builder= boolQuery();
        builder.must(QueryBuilders.matchQuery("_all", term).operator(MatchQueryBuilder.Operator.AND));


Thank You..

On Thursday, June 4, 2015 at 2:37:28 PM UTC+5:30, Jason Wee wrote:
query = filteredQuery(QueryBuilders.queryString("2000/sun").defaultOperator("and"), null);
                
response = client.prepareSearch(yemme).setTypes(ymmetype).setQuery(query).setSize(20).execute().actionGet();
                        
in query string, you might want to escape the slash as it means something like the regex usage.

es has moved to <a href="https://discuss.elastic.co/" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fdiscuss.elastic.co%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFguF42tUvBArAl-xFnDHHIi5v0cA';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fdiscuss.elastic.co%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFguF42tUvBArAl-xFnDHHIi5v0cA';return true;">https://discuss.elastic.co/ , you should post your question there.

hth

jason


On Thursday, June 4, 2015 at 3:32:54 PM UTC+8, Muddadi Hemaanusha wrote:
Hi,

Am using a query :

GET ymme/ymmetype/_search
{
    "size": 20,
    "query": {
       "match": {
           "_all":
           {
               "query": "2000/sun ",
               "operator": "and"
           }
       }
    }
}

I would like to use the relevant query using Java API using query builders,

Can anyone post the Java API code to the above query....

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/
---
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/a886c363-15f1-4a9e-adc1-9975ef8f2078%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.