# Get only matched fields in highlight

(ibotty) #1

hi,

i'm pretty new to elasticsearch and like it so far. indexing and
searching works wonderful!

for the one problem i have with it for now, i have searched for quiet
some time, and it seems not possible (as far as i understood). i have
some pretty easy documents stored (say: {"a" : "text", "b":
"taxt" } ). for the moment i'm searching for them with a simple
wildcard query: {"query": {"wildcard": {"_all" :"text"}}, "highlight":
{"fields": {"b" : {}, "a" : {}}}}

this returns:
[...] "highlight" : {
"a" : [ "text"],
"b" : [taxt]
} [...]

i'd like to only get the matched field (here: "a").

i can hack around it, but i'd really like not to do this. so: is this
possible, and if so, how?

thank you all for your work!
ibotty

(system) #2