Sha256: 2e1d910fc1c29f03a5d4b77bbf283877d0510677d51e4109563b22440a83c80e

Contents?: true

Size: 896 Bytes

Versions: 7

Compression:

Stored size: 896 Bytes

Contents

# Tasks for manually testing your engine configuration.
#
desc "Try the given text in the indexer/query (index and category optional)."
task :try, [:text, :index, :category] => :application do |_, options|
  text, index, category = options.text, options.index, options.category

  puts
  fail "\x1b[31mrake try needs a text to try indexing and query preparation\x1b[m, e.g. rake 'try[yourtext]'." unless text

  specific = Indexes
  specific = specific[index]    if index
  specific = specific[category] if category

  puts "\"#{text}\" is saved in the #{specific.identifier} index as #{specific.tokenizer.tokenize(text.dup).to_a}"

  puts "\"#{text}\" as a search will be tokenized into #{Tokenizers::Query.default.tokenize(text.dup).to_a.map(&:to_s).map(&:to_sym)}"
  puts
  puts "(category qualifiers, e.g. title: are removed if they do not exist as a qualifier, so 'toitle:bla' -> 'bla')"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
picky-3.0.0 lib/tasks/try.rake
picky-3.0.0.pre5 lib/tasks/try.rake
picky-3.0.0.pre4 lib/tasks/try.rake
picky-3.0.0.pre3 lib/tasks/try.rake
picky-3.0.0.pre2 lib/tasks/try.rake
picky-3.0.0.pre1 lib/tasks/try.rake
picky-2.7.0 lib/tasks/try.rake