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::Index#initialize
Create a new index with a given source.
=== Parameters
* name: A name that will be used for the index directory and in the Picky front end.
=== Options (all are used in the block - not passed as a Hash, see examples)
* source: Where the data comes from, e.g. Sources::CSV.new(...). Optional, can be defined in the block using #source.
* result_identifier: Use if you'd like a different identifier/name in the results than the name of the index.
* after_indexing: As of this writing only used in the db source. Executes the given after_indexing as SQL after the indexing process.
* indexing: Call and pass either a tokenizer (responds to #tokenize) or the options for a tokenizer..
* key_format: Call and pass in a format method for the ids (default is #to_i).
Example:
my_index = Index.new(:my_index) do
source Sources::CSV.new(file: 'data/index.csv')
key_format :to_sym
category :bla
result_identifier :my_special_results
endEdit
git clone [email protected]:floere/picky.git
cd picky
open server/lib/picky/index.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Picky--Index-initialize-for-pr
# Commit to gitgit add server/lib/picky/index.rbgit commit -m "better docs for Picky::Index#initialize"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Picky--Index-initialize-for-pr
hub pull-request
# Celebrate!