Zatvobor/tirexs

Highlight DSL

syamilmj opened this issue · 4 comments

ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html

This works but it doesn't look idiomatic:

highlight do
  ["fields": ["title": [{}]]]
end

Am I doing it correctly?

It looks good.

If we are not supporting enough fields in the DSL, then the snippet above is closer to sending a raw JSON payload.

I mean, look at this bit: "title": [{}]. That is not an improvement over JSON - it's more confusing and less intuitive.

Would this still be open for improvements? I'd be happy to contribute.

@syamilmj in general our idea is to remove dsl from tirexs, and use plain json in code for create queries. It will be more easy manage ES versions and updates, you don't need update tirexs every time when something changed id ES. This why we stop support DSL part in this library.

Thanks for the clarification @OpakAlex! :)