Class: Estraier::Condition

Class | Estraier::Condition
In: | estraier-doc.rb
Parent: | Object

Abstraction of search condition.

### Methods

add_attr new set_auxiliary set_distinct set_eclipse set_mask set_max set_options set_order set_phrase set_skip

### Constants

SURE | = | 1 << 0 |  | option: check every N-gram key
USUAL | = | 1 << 1 |  | option: check N-gram keys skipping by one
FAST | = | 1 << 2 |  | option: check N-gram keys skipping by two
AGITO | = | 1 << 3 |  | option: check N-gram keys skipping by three
NOIDF | = | 1 << 4 |  | option: without TF-IDF tuning
SIMPLE | = | 1 << 10 |  | option: with the simplified phrase
ROUGH | = | 1 << 11 |  | option: with the rough phrase
UNION | = | 1 << 15 |  | option: with the union phrase
ISECT | = | 1 << 16 |  | option: with the intersection phrase
ECLSIMURL | = | 10.0 |  | eclipse tuning: consider URL
ECLSERV | = | 100.0 |  | eclipse tuning: on server basis
ECLDIR | = | 101.0 |  | eclipse tuning: on directory basis
ECLFILE | = | 102.0 |  | eclipse tuning: on file basis

### Public Class methods

new()

Create a search condition object.

### Public Instance methods

add_attr(expr)

Add an expression for an attribute. `expr’ specifies an expression for an attribute. The return value is always `nil’.

set_auxiliary(min)

Set permission to adopt result of the auxiliary index. `min’ specifies the minimum hits to adopt result of the auxiliary index. If it is not more than 0, the auxiliary index is not used. By default, it is 32. The return value is always `nil’.

set_distinct(name)

Set the attribute distinction filter. `name’ specifies the name of an attribute to be distinct. The return value is always `nil’.

set_eclipse(limit)

Set the lower limit of similarity eclipse. `limit’ specifies the lower limit of similarity for documents to be eclipsed. Similarity is between 0.0 and 1.0. If the limit is added by `Condition::ECLSIMURL’, similarity is weighted by URL. If the limit is `Condition::ECLSERV’, similarity is ignored and documents in the same server are eclipsed. If the limit is `Condition::ECLDIR’, similarity is ignored and documents in the same directory are eclipsed. If the limit is `Condition::ECLFILE’, similarity is ignored and documents of the same file are eclipsed. The return value is always `nil’.

set_mask(mask)

Set the mask of targets of meta search. `mask’ specifies a masking number. 1 means the first target, 2 means the second target, 4 means the third target, and power values of 2 and their summation compose the mask. The return value is always `nil’.

set_max(max)

Set the maximum number of retrieval. `max’ specifies the maximum number of retrieval. By default, the number of retrieval is not limited. The return value is always `nil’.

set_options(options)

Set options of retrieval. `options’ specifies options: `Condition::SURE’ specifies that it checks every N-gram key, `Condition::USU’, which is the default, specifies that it checks N-gram keys with skipping one key, `Condition::FAST’ skips two keys, `Condition::AGITO’ skips three keys, `Condition::NOIDF’ specifies not to perform TF-IDF tuning, `Condition::SIMPLE’ specifies to use simplified phrase, `Condition::ROUGH’ specifies to use rough phrase, `Condition::UNION’ specifies to use union phrase, `Condition::ISECT’ specifies to use intersection 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. The return value is always `nil’.

set_order(expr)

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

set_phrase(phrase)

Set the search phrase. `phrase’ specifies a search phrase. The return value is always `nil’.

set_skip(skip)

Set the number of skipped documents. `skip’ specifies the number of documents to be skipped in the search result. The return value is always `nil’.

[Validate]