picky

https://github.com/floere/picky

HTML

Picky is an easy to use and fast Ruby semantic search engine that helps your users find what they are looking for.

Picky::Search#ignore_unassigned_tokens

Ignore the given token if it cannot be matched to a category.
The default behaviour is that if a token does not match to
any category, the query will not return anything (since a
single token cannot be matched). If you set this option to
true, any token that cannot be matched to a category will be
simply ignored.

Use this if only a few matched words are important, like for
example of the query "Jonathan Myers 86455 Las Cucarachas"
you only want to match the zipcode, to have the search engine
display advertisements on the side for the zipcode.

False by default.

Example:
  search = Search.new(books_index, dvd_index, mp3_index) do
    ignore_unassigned_tokens
  end

With this set (to true), if in "Peter Flunder", "Flunder"
couldn't be assigned to any category, it will simply be
ignored. This is done for each categorization.

Source | Google | Stack overflow

Edit

git clone [email protected]:floere/picky.git

cd picky

open server/lib/picky/search.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Picky--Search-ignore_unassigned_tokens-for-pr


# Commit to git

git add server/lib/picky/search.rbgit commit -m "better docs for Picky::Search#ignore_unassigned_tokens"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Picky--Search-ignore_unassigned_tokens-for-pr

hub pull-request


# Celebrate!