nazrin
nazrin copied to clipboard
Add support for highlight search option in struct
I supported highlight search option using struct pattern.
result = Movie.search.query('movie').highlight({title: {format: 'text'}}.to_json).execute
result.first.highlights.title
# => Extreme *Movie*
I didn't add anything to the README because I didn't know what to add.
TODO
- [ ] Update README
Highlight option already exists. https://github.com/tsuwatch/nazrin/blob/v2.7.0/lib/nazrin/search_client.rb#L94 Could you use it?
Yes, I tried it. But the highlight option is not working.
https://github.com/tsuwatch/nazrin/pull/39/files#diff-db52a6d091a77dc5ae58d47b33a89f8cR45
When used highlight option, return hit[:highlights]
.
We need to mapping hit[:highlights]
.
Ok, certainly not mapped.
Could you implement using Result
class?
https://github.com/tsuwatch/nazrin/blob/master/lib/nazrin/result.rb