Match Query - Can you help me?


(Giorgi Kharchenko) #1

Hi,
I want to search this kind of thing.
I have fields like this.

identifiers:[{key: "list1", value:"My name is Giorgi"}, {key:"list2", value:"Giorgi"}, {key:"list3", value:"Giorgi Kharchenko"}]

{
	"query" :{
		"bool" :{
			"must" : {
				"match_phrase" :{
						"identifiers.value" : "Giorgi"
								}
						}
					}
				}	
		}
}

So I want to get records which contains identifiers that includes search value for value property.
{key:"list2", value:"Giorgi"}

I am not sure how I can build the query.
I tried with term query but was not good.


Term Query is not working
(Super Yang) #2

I think what you need is "wildcard", it can implement similar function as "SQL like"


(Giorgi Kharchenko) #3

well , can you post sample code if possible?


(David Pilato) #4

No. Please do not use wildcard unless you are happy with slow queries.


(Giorgi Kharchenko) #5

What is the solution?


(David Pilato) #6

You asked similar question in Term Query is not working so please let's keep the discussion in a single place. I'm going to close this topic.


(David Pilato) #7