Generating extra-fields to my results based on query

Hi everyone,

I’m discovering ElasticSearch and I really don’t know how to find this kind of feature in the ES documentation.
My goal is to add extra-fields to the result of a query ; the extra-fields being themselves a response of another query.

For instance, I have Ads and I want to add an extra-field such as {car : true} if the Ad description contains the word "car".
I guess it's possible as the Script Field feature almost do that.

Any idea ?
Thanks for your clues

Ovinz

Hello @ovinz

Take a look at the section [Creating a Scripted Field] section at this doc.

Hello @amrmostafazaki

Thanks for your response.

Indeed I'm pretty sure it's all about that, you're right, but do you know if I can do that with a Query ?
To be clear, can I run a "match_phrase" with fuzzy for typos, levenstein distance... instead of a "IndexOf" like this ?

https://discuss.elastic.co/t/check-if-a-field-string-start-with-a-determinate-string/108612/2

Thanks again

Ovinz

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.