# Newbie question--search based on multimatch or queryString

**URL:** <https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338>\
**Category:** Elasticsearch\
**Created:** [March 27, 2013, 3:17pm UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338 "2013-03-27T15:17:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saikat\_Kanjilal](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Saikat\_Kanjilal](https://discuss.elastic.co/u/Saikat_Kanjilal)\
**Post date:** [March 27, 2013, 3:17pm UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/1 "2013-03-27T15:17:40Z")

</div>

Hello Folks,  
I am new to elasticsearch (as well as to Lucene) and have some questions, I  
have followed the Java Jest API to build some code into our rest API to  
call into elasticsearch to perform inserts and searches. So far inserts  
work pretty easily , however other than basic searches I am not getting any  
results back from any of my searches through the Java API, here's some  
context:

Basic search results without any qualifiers (apologize for length of this):  
"hits":  
{  
"total": 2,  
"max\_score": 1,  
"hits":  
[  
{  
"\_index": "foo.bar",  
"\_type": "elasticsearch",  
"\_id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
"\_score": 1,  
"\_source":  
{  
"application": "TEST",  
"line": "1",  
"text\_all": "this is funny message",  
"sequenceNum": 1,  
"batch\_id": "1",  
"timestamp": "NOW",  
"id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
"message": "this is really funny message",  
"time": 1349514767441,  
"level": "Debug",  
"file": "file1",  
"thread": "thread1",  
"logger": "slogger",  
"grid": "grid",  
"start\_time": 1349514767441,  
"appliance": "appliance3"  
}  
},  
{  
"\_index": "foo.bar",  
"\_type": "elasticsearch",  
"\_id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
"\_score": 1,  
"\_source":  
{  
"application": "TEST",  
"line": "1",  
"text\_all": "this is bazaar message",  
"sequenceNum": 1,  
"batch\_id": "2",  
"timestamp": "NOW",  
"id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
"message": "this is bazaar message",  
"time": 1349514767441,  
"level": "Info",  
"file": "file1",  
"thread": "thread1",  
"logger": "slogger",  
"grid": "grid2",  
"start\_time": 1349514767441,  
"appliance": "appliance2"  
}  
}  
]  
}

Here's an example of the search request body that results from my code:

{  
"from" : 0,  
"size" : 10,  
"query" : {  
"multi\_match" : {  
"query" : "appliance2",  
"fields" : ["application,appliance"]  
}  
},  
"filter" : {  
"range" : {  
"time" : {  
"from" : 1349514767442,  
"to" : 1349514767444,  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
},  
"fields" : [],  
"sort" : [ {  
"time" : {  
"order" : "desc"  
}  
} ]  
}

I have tried to call ES directly and paste the above into the request body  
and it is also not returning any results. My usecase is such that I have  
mutliple keys that have the same value, for example I have  
appliance,application and I might have a value of appliance2, I have tried  
to built a querystring as well as a multi match query using the Jest API  
and neither seem to return any results, am I missing something obvious  
here, I have scoured the docs and the mailing list and didnt see anything  
that would be insightful. My code seems to be in order so I am placing  
my bet on how I'm doing the search. I appreciate some insight on this.

Regards

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Saikat\_Kanjilal](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Saikat\_Kanjilal](https://discuss.elastic.co/u/Saikat_Kanjilal)\
**Post date:** [March 27, 2013, 3:30pm UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/2 "2013-03-27T15:30:14Z")

</div>

One other piece of metadata, even if I remove the sort filter I am using  
for time I get zero results.

On Wednesday, March 27, 2013 8:17:40 AM UTC-7, Saikat Kanjilal wrote:

> Hello Folks,  
> I am new to elasticsearch (as well as to Lucene) and have some questions,  
> I have followed the Java Jest API to build some code into our rest API to  
> call into elasticsearch to perform inserts and searches. So far inserts  
> work pretty easily , however other than basic searches I am not getting any  
> results back from any of my searches through the Java API, here's some  
> context:
> 
> Basic search results without any qualifiers (apologize for length of this):  
> "hits":  
> {  
> "total": 2,  
> "max\_score": 1,  
> "hits":  
> [  
> {  
> "\_index": "foo.bar",  
> "\_type": "elasticsearch",  
> "\_id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> "\_score": 1,  
> "\_source":  
> {  
> "application": "TEST",  
> "line": "1",  
> "text\_all": "this is funny message",  
> "sequenceNum": 1,  
> "batch\_id": "1",  
> "timestamp": "NOW",  
> "id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> "message": "this is really funny message",  
> "time": 1349514767441,  
> "level": "Debug",  
> "file": "file1",  
> "thread": "thread1",  
> "logger": "slogger",  
> "grid": "grid",  
> "start\_time": 1349514767441,  
> "appliance": "appliance3"  
> }  
> },  
> {  
> "\_index": "foo.bar",  
> "\_type": "elasticsearch",  
> "\_id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> "\_score": 1,  
> "\_source":  
> {  
> "application": "TEST",  
> "line": "1",  
> "text\_all": "this is bazaar message",  
> "sequenceNum": 1,  
> "batch\_id": "2",  
> "timestamp": "NOW",  
> "id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> "message": "this is bazaar message",  
> "time": 1349514767441,  
> "level": "Info",  
> "file": "file1",  
> "thread": "thread1",  
> "logger": "slogger",  
> "grid": "grid2",  
> "start\_time": 1349514767441,  
> "appliance": "appliance2"  
> }  
> }  
> ]  
> }
> 
> Here's an example of the search request body that results from my code:
> 
> {  
> "from" : 0,  
> "size" : 10,  
> "query" : {  
> "multi\_match" : {  
> "query" : "appliance2",  
> "fields" : ["application,appliance"]  
> }  
> },  
> "filter" : {  
> "range" : {  
> "time" : {  
> "from" : 1349514767442,  
> "to" : 1349514767444,  
> "include\_lower" : true,  
> "include\_upper" : true  
> }  
> }  
> },  
> "fields" : ,  
> "sort" : [ {  
> "time" : {  
> "order" : "desc"  
> }  
> } ]  
> }
> 
> I have tried to call ES directly and paste the above into the request body  
> and it is also not returning any results. My usecase is such that I have  
> mutliple keys that have the same value, for example I have  
> appliance,application and I might have a value of appliance2, I have tried  
> to built a querystring as well as a multi match query using the Jest API  
> and neither seem to return any results, am I missing something obvious  
> here, I have scoured the docs and the mailing list and didnt see anything  
> that would be insightful. My code seems to be in order so I am placing  
> my bet on how I'm doing the search. I appreciate some insight on this.
> 
> Regards

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 27, 2013, 4:41pm UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/3 "2013-03-27T16:41:57Z")

</div>

I think your issue is here:  
"fields" : ["application,appliance"]

Check the multi match doc.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 mars 2013 à 16:30, Saikat Kanjilal [sxk1969@gmail.com](mailto:sxk1969@gmail.com) a écrit :

> One other piece of metadata, even if I remove the sort filter I am using for time I get zero results.
> 
> On Wednesday, March 27, 2013 8:17:40 AM UTC-7, Saikat Kanjilal wrote:
> 
> > Hello Folks,  
> > I am new to elasticsearch (as well as to Lucene) and have some questions, I have followed the Java Jest API to build some code into our rest API to call into elasticsearch to perform inserts and searches. So far inserts work pretty easily , however other than basic searches I am not getting any results back from any of my searches through the Java API, here's some context:
> > 
> > Basic search results without any qualifiers (apologize for length of this):  
> > "hits":  
> > {  
> > "total": 2,  
> > "max\_score": 1,  
> > "hits":  
> > [  
> > {  
> > "\_index": "foo.bar",  
> > "\_type": "elasticsearch",  
> > "\_id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> > "\_score": 1,  
> > "\_source":  
> > {  
> > "application": "TEST",  
> > "line": "1",  
> > "text\_all": "this is funny message",  
> > "sequenceNum": 1,  
> > "batch\_id": "1",  
> > "timestamp": "NOW",  
> > "id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> > "message": "this is really funny message",  
> > "time": 1349514767441,  
> > "level": "Debug",  
> > "file": "file1",  
> > "thread": "thread1",  
> > "logger": "slogger",  
> > "grid": "grid",  
> > "start\_time": 1349514767441,  
> > "appliance": "appliance3"  
> > }  
> > },  
> > {  
> > "\_index": "foo.bar",  
> > "\_type": "elasticsearch",  
> > "\_id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> > "\_score": 1,  
> > "\_source":  
> > {  
> > "application": "TEST",  
> > "line": "1",  
> > "text\_all": "this is bazaar message",  
> > "sequenceNum": 1,  
> > "batch\_id": "2",  
> > "timestamp": "NOW",  
> > "id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> > "message": "this is bazaar message",  
> > "time": 1349514767441,  
> > "level": "Info",  
> > "file": "file1",  
> > "thread": "thread1",  
> > "logger": "slogger",  
> > "grid": "grid2",  
> > "start\_time": 1349514767441,  
> > "appliance": "appliance2"  
> > }  
> > }  
> > ]  
> > }
> > 
> > Here's an example of the search request body that results from my code:
> > 
> > {  
> > "from" : 0,  
> > "size" : 10,  
> > "query" : {  
> > "multi\_match" : {  
> > "query" : "appliance2",  
> > "fields" : ["application,appliance"]  
> > }  
> > },  
> > "filter" : {  
> > "range" : {  
> > "time" : {  
> > "from" : 1349514767442,  
> > "to" : 1349514767444,  
> > "include\_lower" : true,  
> > "include\_upper" : true  
> > }  
> > }  
> > },  
> > "fields" : ,  
> > "sort" : [ {  
> > "time" : {  
> > "order" : "desc"  
> > }  
> > } ]  
> > }
> > 
> > I have tried to call ES directly and paste the above into the request body and it is also not returning any results. My usecase is such that I have mutliple keys that have the same value, for example I have appliance,application and I might have a value of appliance2, I have tried to built a querystring as well as a multi match query using the Jest API and neither seem to return any results, am I missing something obvious here, I have scoured the docs and the mailing list and didnt see anything that would be insightful. My code seems to be in order so I am placing my bet on how I'm doing the search. I appreciate some insight on this.
> > 
> > Regards  
> > --  
> > 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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Saikat\_Kanjilal](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@Saikat\_Kanjilal](https://discuss.elastic.co/u/Saikat_Kanjilal)\
**Post date:** [March 27, 2013, 5:22pm UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/4 "2013-03-27T17:22:45Z")

</div>

David,  
Thanks for the response, I found this issue right after I sent this out,  
which lead to another issue, I currently have a Set of strings of arbitrary  
size fro the keys, is there an easy way to put this into the multimatch  
API, it seems like the API requires a comma separated list of individual  
strings?  
Thanks

On Wednesday, March 27, 2013 8:17:40 AM UTC-7, Saikat Kanjilal wrote:

> Hello Folks,  
> I am new to elasticsearch (as well as to Lucene) and have some questions,  
> I have followed the Java Jest API to build some code into our rest API to  
> call into elasticsearch to perform inserts and searches. So far inserts  
> work pretty easily , however other than basic searches I am not getting any  
> results back from any of my searches through the Java API, here's some  
> context:
> 
> Basic search results without any qualifiers (apologize for length of this):  
> "hits":  
> {  
> "total": 2,  
> "max\_score": 1,  
> "hits":  
> [  
> {  
> "\_index": "foo.bar",  
> "\_type": "elasticsearch",  
> "\_id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> "\_score": 1,  
> "\_source":  
> {  
> "application": "TEST",  
> "line": "1",  
> "text\_all": "this is funny message",  
> "sequenceNum": 1,  
> "batch\_id": "1",  
> "timestamp": "NOW",  
> "id": "130cdcba-58ad-4de7-ade1-00b5257b106f",  
> "message": "this is really funny message",  
> "time": 1349514767441,  
> "level": "Debug",  
> "file": "file1",  
> "thread": "thread1",  
> "logger": "slogger",  
> "grid": "grid",  
> "start\_time": 1349514767441,  
> "appliance": "appliance3"  
> }  
> },  
> {  
> "\_index": "foo.bar",  
> "\_type": "elasticsearch",  
> "\_id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> "\_score": 1,  
> "\_source":  
> {  
> "application": "TEST",  
> "line": "1",  
> "text\_all": "this is bazaar message",  
> "sequenceNum": 1,  
> "batch\_id": "2",  
> "timestamp": "NOW",  
> "id": "8b8ax134-7ad3-4e3c-9e4c-f19a0d4f0009",  
> "message": "this is bazaar message",  
> "time": 1349514767441,  
> "level": "Info",  
> "file": "file1",  
> "thread": "thread1",  
> "logger": "slogger",  
> "grid": "grid2",  
> "start\_time": 1349514767441,  
> "appliance": "appliance2"  
> }  
> }  
> ]  
> }
> 
> Here's an example of the search request body that results from my code:
> 
> {  
> "from" : 0,  
> "size" : 10,  
> "query" : {  
> "multi\_match" : {  
> "query" : "appliance2",  
> "fields" : ["application,appliance"]  
> }  
> },  
> "filter" : {  
> "range" : {  
> "time" : {  
> "from" : 1349514767442,  
> "to" : 1349514767444,  
> "include\_lower" : true,  
> "include\_upper" : true  
> }  
> }  
> },  
> "fields" : ,  
> "sort" : [ {  
> "time" : {  
> "order" : "desc"  
> }  
> } ]  
> }
> 
> I have tried to call ES directly and paste the above into the request body  
> and it is also not returning any results. My usecase is such that I have  
> mutliple keys that have the same value, for example I have  
> appliance,application and I might have a value of appliance2, I have tried  
> to built a querystring as well as a multi match query using the Jest API  
> and neither seem to return any results, am I missing something obvious  
> here, I have scoured the docs and the mailing list and didnt see anything  
> that would be insightful. My code seems to be in order so I am placing  
> my bet on how I'm doing the search. I appreciate some insight on this.
> 
> Regards

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![rakesh\_rkr11](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rakesh\_rkr11](https://discuss.elastic.co/u/rakesh_rkr11)\
**Post date:** [March 28, 2013, 10:15am UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/5 "2013-03-28T10:15:10Z")

</div>

Hi,

I am new to elasticsearch and have some questions, I have followed the Java  
Jest API to build some code into our rest API to call into elasticsearch to  
perform inserts and searches.

I have to display text in multiple languages in one language search..means  
i search from english langauage then only english text are coming not  
france or german language.and i have to display all the language text  
whatever available in the index.

So,Please suggest me what i have to do..

--  
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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:44am UTC](https://discuss.elastic.co/t/newbie-question-search-based-on-multimatch-or-querystring/11338/6 "2017-07-06T02:44:01Z")

</div>


