Exact match query


(IronMike) #1

I would like to match multiple of exact phrases, is it possible?

I would like to search in one field "myfield" for exact phrases: "My exact
phrase 1" & "My exact phrase 2"

//This is code for one phrase match, how to combine with the other?
"query": {
"match_phrase": {
"myfield": "My exact phrase 1"
}
}

--
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/50032da6-bb6b-4e47-8ade-0e2d0d3315c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Alexander Reelsen) #2

Hey,

you could use a bool query with several must clauses, which in turn contain
several match_phrase clauses. See
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html#query-dsl-bool-query

--Alex

On Tue, Jul 22, 2014 at 10:57 PM, IronMike sabdalla80@gmail.com wrote:

I would like to match multiple of exact phrases, is it possible?

I would like to search in one field "myfield" for exact phrases: "My exact
phrase 1" & "My exact phrase 2"

//This is code for one phrase match, how to combine with the other?
"query": {
"match_phrase": {
"myfield": "My exact phrase 1"
}
}

--
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/50032da6-bb6b-4e47-8ade-0e2d0d3315c8%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/50032da6-bb6b-4e47-8ade-0e2d0d3315c8%40googlegroups.com?utm_medium=email&utm_source=footer
.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM9KKLGLh1gOnVNf1X--72FkVgLaYx90DKPPHb__96E0tw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3