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#terminate_early

Tells Picky to terminate calculating ids if it has enough ids.
(So, early)

Important note: Do not use this for the live search!
(As Picky needs to calculate the total)

Note: When using the Picky interface, do not terminate too
early as this will kill off the allocation selections.
A value of
   terminate_early 5
is probably a good idea to show the user 5 extra
beyond the needed ones.

Examples:
  # Terminate if you have enough ids.
  #
  search = Search.new(index1, index2, index3) do
    terminate_early
  end

  # After calculating enough ids,
  # calculate 5 extra allocations for the interface.
  #
  search = Search.new(index1, index2, index3) do
    terminate_early 5
  end

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-terminate_early-for-pr


# Commit to git

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


# 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-terminate_early-for-pr

hub pull-request


# Celebrate!