mongoid_fulltext icon indicating copy to clipboard operation
mongoid_fulltext copied to clipboard

Return the `highlight` on search

Open luizkowalski opened this issue 12 years ago • 3 comments

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?

luizkowalski avatar Apr 11 '13 15:04 luizkowalski

This would be great!

:+1:

caarlos0 avatar Apr 13 '13 04:04 caarlos0

Yes, for searching larger texts this would be awesome. :+1:

zeevallin avatar Apr 25 '13 13:04 zeevallin

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.

dblock avatar Nov 25 '15 13:11 dblock