Return the `highlight` on search
luizkowalski opened this issue · 3 comments
luizkowalski commented
If you are indexing text, by example, with ElasticSearch, you can get a portion of the text where the search was found, using highlight
, so that you can highlight content matching the query.
Would be awesome if mongoid_fulltext could do the same.
Is it possible?
caarlos0 commented
This would be great!
👍
zeevallin commented
Yes, for searching larger texts this would be awesome. 👍
dblock commented
It's a valid feature request. It needs some thought about how it would be implemented in mongoid_fulltext. To be added to this gem it would need to leverage the database, ie. n-gram data stored has associated metadata that points directly to where the text is located in the text being searched, probably just start and end of the word.