Ok. Try BoolQuery with should clauses.
For the nested field, use the NestedQuery with a MatchQuery.
For the other fields, use the MultiMatch Query
Does it help?
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 11 nov. 2013 à 08:01, Aditya Herlambang aditya15417@gmail.com a écrit :
Let me explain my scenario.
I have a Shop, the shop has a username and also a full name.
The Shop has a nested property which is shopPictures, and each shopPictures has a caption associated with it. So this shopPictures is nested.
I wanted to do a search on the caption's first and then the username and full name as the priority. When I do the multi query it doesn't search the caption of the shopPictures.
How do I do so?
On Monday, November 11, 2013 12:52:16 PM UTC+7, David Pilato wrote:
Why do you define a nested document?
As far as I can see, you probably don't need it here.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 11 nov. 2013 à 05:40, Aditya Herlambang adity...@gmail.com a écrit :
I also think in this case I'd have to use the nested query?
On Monday, November 11, 2013 11:36:54 AM UTC+7, Aditya Herlambang wrote:
So I tried using multi match query by specifying the following:
{
"multi_match" : {
"query" : "some query",
"fields" : [ "username", "fullname", "caption" ]
}
}
however it seems now the search is not searching the caption (while in fact caption is the single most important one). Why is this? I believe this is because the caption is a nested property inside the shop.
So how do I specify the nested property to be searched in a multi match?
On Sunday, November 10, 2013 2:21:08 AM UTC+7, David Pilato wrote:
Sorry I meant: +q=moonl +q=shop_name:moonl is equivalent to q=moonl and q=shop_name:moonl.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 9 nov. 2013 à 19:31, David Pilato da...@pilato.fr a écrit :
You can search for q=moonl q=shop_name:moonl
Or +q=moonl and +q=shop_name:moonl
But I really recommend using QueryDsl Elasticsearch Platform — Find real-time answers at scale | Elastic
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Le 9 nov. 2013 à 16:11, Aditya Herlambang adity...@gmail.com a écrit :
but doing q=shop_name:moonl means that i will only be searching on the store name and not the shops picture caption, is there a way to make multiple search at one? so doing q=moonl and q=shop_name:moonl at the same time?
--
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.
For more options, visit 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 elasticsearc...@googlegroups.com.
For more options, visit 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 elasticsearc...@googlegroups.com.
For more options, visit 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.
For more options, visit 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.
For more options, visit https://groups.google.com/groups/opt_out.