Skip to content
floere edited this page Oct 27, 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::Substring.new(:from => -3) (negative numbers count from the end), which means that you will get a result when searching for:

  • “Yukihiro Matsumo”
  • “Yukihiro Matsumot”
  • “Yukihiro Matsumoto” (from the exact index)

It is intensive, generating an index for all subtokens of e.g. Matsumoto.
If you don’t need partial searching:

field(:title, :partial => Partial::None.new)

Like this you find only:

  • “Yukihiro Matsumoto”

Another option is one that starts from the e.g. fifth character:

field(:title, :partial => Partial::Substring.new(:from => 5))

That would yield:

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

(Usually the negative value makes more sense)

Hope that helps!