This is the reference document for all the APIs that can be used in Picky.
It denotes several areas where you can customize/plug into Picky.
Has methods
tokenize(text)
=>[ [:token1, :token2, ...], ["Original1", "Original2", ...] ]
(2-D array of the tokens and the original texts)
Accepted by
Sinatra::Application#indexing
Sinatra::Application#searching
Picky::Index#indexing
Picky::Search#searching
Picky::Category.new(indexing: tokenizer_instance)
Has methods
substitute(text)
=>substituted_text
(with characters replaced)
Accepted as
- option
substitutes_characters_with
forindexing
andsearching
.
Have methods
- TODO See examples in lib/picky/backends
Accepted by
Picky::Index#backend(backend_instance)
Has methods
each(&block)
yieldsobjects
(that respond to methods listed in the categories, or in the categories’from
option)
Has methods
weight_for(amount_of_ids)
=>float
(a weight)
Accepted as option weight
for the category
.
Has methods
each_partial(token, &block)
yields eachpartialized token
Accepted as option partial
for the category
.
Has methods
encode(token)
=>encoded token
prioritize(similar_encoded_array, encoded)
(Gives your similarity a chance to lop off superfluous similars and reorder the array)
Accepted as option similarity
for the category
.
Has methods
Picky::Search#search(text, ids = 20, offset = 0)
=>Picky::Results
(an instance)
Has methods
boost_for(array_of_combinations)
=>float
(A negative or positive weight)
Accepted as parameter for the boost
method in a Search.new
block.
Has methods
prepare!
=>unimportant
(prepares the search results, called by the Picky search)ids(amount = 20)
=>[id1, id2, id3, ...]
(a list of ids in order of importance)total
=>1234
(the total number of – calculated – results)duration
=>1.234
(a float)to_hash
=>{...}
(a hash representation of the results)to_json
→"{...}"
(a json representation of the hash representation of the results)to_s
=>log output
(a string for log output)