Add the ability to match on phrase instead of word. #23

Open
wants to merge 1 commit into
from

2 participants

@mootpointer

There are some cases where it is require to match exact phrases and not
words. Thus I have created a PhraseLoader and PhraseMatcher for the
purpose of working with phrases.

That means that if you have the phrase "awesome stuff", the term "awes"
will match, but the term "stuf" will not.

I have not yet enabled phrase loading through the CLI, only by
explicitly loading with a PhraseLoader class. The PhraseLoader has an
identical interface to the standard Loader, it just refrains from
normalising anything, because that gets messy with phrases.

When it comes to matching, supplying phrase=true as part of the query
string will tell the Soulmate::Server to use the PhraseMatcher, and
successfully match the loaded phrases.

@mootpointer mootpointer Add the ability to match on phrase instead of word.
There are some cases where it is require to match exact phrases and not
words. Thus I have created a PhraseLoader and PhraseMatcher for the
purpose of working with phrases.

That means that if you have the phrase "awesome stuff", the term "awes"
will match, but the term "stuf" will not.

I have not yet enabled phrase loading through the CLI, only by
explicitly loading with a PhraseLoader class. The PhraseLoader has an
identical interface to the standard Loader, it just refrains from
normalising anything, because that gets messy with phrases.

When it comes to matching, supplying phrase=true as part of the query
string will tell the Soulmate::Server to use the PhraseMatcher, and
successfully match the loaded phrases.
7255823
@mootpointer

This code is currently working in production, quite well as well.

@marbemac

I would be interested in this, +1

@mootpointer

@marbemac If you look at Westfield.com.au, our search box currently has this pull request powering our typeahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment