Skip to content
Florian Hanke edited this page Oct 19, 2010 · 24 revisions

FAQ

Where to ask my questions?

How can I make Picky weigh certain results higher?

See weights option in Queries Configuration.

In short: Queries take an option, for example

:weights => Query::Weights.new([:title, :author] => 3)

that gives bonus points to the title-author combination. (6 is high, 0 is the default, -6 is a harsh penalty)

Note that the order is important.

How can I make the indexing faster?

Currently, Picky uses as default a partial index (for * Queries, like “Yukihiro Matsu*”) a generator Partial::Subtoken.new(:down_to => 1), which means that you will get a result when searching for:

  • “Yukihiro Matsumoto” (from the exact index)
  • “Yukihiro Matsumot” (from here on from the partial index)
  • “Yukihiro Matsumo”
  • “Yukihiro Matsum”
  • “Yukihiro Matsu”
  • “Yukihiro Mats”
  • “Yukihiro Mat”
  • “Yukihiro Ma”
  • “Yukihiro M”

It is very intensive, generating an index for all subtokens of e.g. Matsumoto.
If you don’t need that, use a partial generator that just goes down 3 characters:

field(:title, :partial => Partial::Subtoken.new(:down_to => -3))

Like this you find:

  • “Yukihiro Matsumot”
  • “Yukihiro Matsumo”
  • “Yukihiro Matsum”

Or absolute, one that goes down to the e.g. fourth character:

field(:title, :partial => Partial::Subtoken.new(:down_to => 4))

That would yield:

  • “Yukihiro Matsumot”
  • “Yukihiro Matsumo”
  • “Yukihiro Matsum”
  • “Yukihiro Matsu”
  • “Yukihiro Mats”

Hope that helps!