Java API Query for _all field in match:


(Anusha) #1

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 elasticsearch+unsubscribe@googlegroups.com.
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.


(Jason Wee) #2

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 elasticsearch+unsubscribe@googlegroups.com.
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.


(Anusha) #3

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 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 elasticsearch+unsubscribe@googlegroups.com.
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.


(Pushpak R Chavan) #4

Hi ,

I am using elastic search 5.1.2 , I have the query like as below.

GET /suggestor/_search
{
"size": 10,
"query": {
"match": {
"_all": {
"query": "ri",
"operator": "and"
}
}
}
}

Can you please let me know how to fetch results using java api.


(system) #5