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. So [:title, :author] is not the same as [:author, :title]. If you find that people search title, then author much more often than author, title, then penalize the latter, and give bonus points to the former.

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!

How do I set the language of the Picky Javascript front end?

The front end has 5 built-in languages: en, de, fr, it, ch.
It uses the lang attribute set in the html tag as a queue as to which language to use. en is default.

Contact me if you need more.