Class Estraier::Condition
In: estraier.rb
Parent: Object

Abstraction of search condition.

Methods

add_attr   attrs   max   new   options   order   phrase   set_max   set_options   set_order   set_phrase  

Constants

CONDSURE = 1 << 0   option: check N-gram keys skipping by three
CONDUSU = 1 << 1   option: check N-gram keys skipping by two
CONDFAST = 1 << 2   option: without TF-IDF tuning
CONDAGIT = 1 << 3   option: with the simplified phrase
CONDNOIDF = 1 << 4   option: check every N-gram key
CONDSIMPLE = 1 << 10   option: check N-gram keys skipping by one

Public Class methods

Create a search condition object.

Public Instance methods

Add an expression for an attribute. `expr’ specifies an expression for an attribute.

Get expressions for attributes. The return value is expressions for attributes.

Get the maximum number of retrieval. The return value is the maximum number of retrieval.

Get options of retrieval. The return value is options by bitwise or.

Get the order expression. The return value is the order expression.

Get the search phrase. The return value is the search phrase.

Set the maximum number of retrieval. `max’ specifies the maximum number of retrieval. By default, the number of retrieval is not limited.

Set options of retrieval. `options’ specifies options: `Condition::ESTCONDSURE’ specifies that it checks every N-gram key, `Condition::ESTCONDUSU’, which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::ESTCONDFAST’ skips two keys, `Condition::ESTCONDAGIT’ skips three keys, `Condition::ESTCONDNOIDF’ specifies not to perform TF-IDF tuning, `Condition::ESTCONDSIMPLE’ specifies to use simplified phrase. Each option can be specified at the same time by bitwise or. If keys are skipped, though search speed is improved, the relevance ratio grows less.

Set the order of a condition object. `expr’ specifies an expression for the order. By default, the order is by score descending.

Set the search phrase. `phrase’ specifies a search phrase.

[Validate]