Skip to content

Highlight when search term is tokenized into individual words #821

Open

Description

@BrentWheeldon

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!

Activity

  1. BrentWheeldon commented on Apr 9, 2014

    @BrentWheeldon
    Author

    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.

  2. jharding commented on Apr 23, 2014

    @jharding
    Contributor

    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.

  3. BrentWheeldon commented on Apr 23, 2014

    @BrentWheeldon
    Author

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

  4. jharding commented on Apr 23, 2014

    @jharding
    Contributor

    I'd lean towards default behavior.

  5. added this to the v1.0.0 milestone on Aug 20, 2014
  6. brandonburkett commented on Feb 10, 2015

    @brandonburkett

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions