Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Highlight when search term is tokenized into individual words #821

Open
BrentWheeldon opened this Issue · 5 comments

3 participants

Brent Wheeldon Jake Harding Brandon Burkett
Brent Wheeldon

Hi there,

We parse our search query into individual terms, which means the builtin highlighting functionality doesn't highlight some results. For example, if we search for "John Boston", and a result of "John Smith Boston" does have any highlighting applied. It seems that the highlight function supports o.pattern being an array, but I can't work out how to split the query on space. Is there a way of customizing the pattern which is passed into the highlight function?

Thanks!

Brent Wheeldon

PS I'm happy to send a PR for this if I can get some guidance on where you'd like this customization to live.

Jake Harding
Collaborator

When I get a chance I'll take a look to see what would need to be done in order to support this. In the meantime, feel free to dive in on your own. This is definitely something I'd like to support.

Brent Wheeldon

Thanks, @jharding. Do you think this should be a default behavior, or something that one could configure?

Jake Harding
Collaborator

I'd lean towards default behavior.

Jake Harding jharding added this to the v1.0.0 milestone
Brandon Burkett

This would be a great feature. Example: "hotels with spa", when typing "hotels" highlighting works, but when we type "hotels spa", neither hotel or spa are highlighted (but the correct suggestion is shown).

Thanks,
Brandon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.