#[repr(i16)]
pub enum FeatureFlag {
    FlagBoolean,
    FlagPhrase,
    FlagLovehate,
    FlagBooleanAnyCase,
    FlagWildcard,
    FlagPureNot,
    FlagPartial,
    FlagSpellingCorrection,
    FlagSynonym,
    FlagAutoSynonyms,
    FlagAutoMultiwordSynonyms,
    FlagDefault,
}
Expand description

Enum of feature flag

Variants§

§

FlagBoolean

Support AND, OR, etc and bracketed subexpressions.

§

FlagPhrase

Support quoted phrases.

§

FlagLovehate

Support + and -.

§

FlagBooleanAnyCase

Support AND, OR, etc even if they aren’t in ALLCAPS.

§

FlagWildcard

Support right truncation (e.g. Xap*).

Currently you can’t use wildcards with boolean filter prefixes, or in a phrase (either an explicitly quoted one, or one implicitly generated by hyphens or other punctuation).

NB: You need to tell the QueryParser object which database to expand wildcards from by calling set_database.

§

FlagPureNot

Allow queries such as ‘NOT apples’.

These require the use of a list of all documents in the database which is potentially expensive, so this feature isn’t enabled by default.

§

FlagPartial

Enable partial matching.

Partial matching causes the parser to treat the query as a “partially entered” search. This will automatically treat the final word as a wildcarded match, unless it is followed by whitespace, to produce more stable results from interactive searches.

Currently FLAG_PARTIAL doesn’t do anything if the final word in the query has a boolean filter prefix, or if it is in a phrase (either an explicitly quoted one, or one implicitly generated by hyphens or other punctuation). It also doesn’t do anything if if the final word is part of a value range.

NB: You need to tell the QueryParser object which database to expand wildcards from by calling set_database.

§

FlagSpellingCorrection

Enable spelling correction.

For each word in the query which doesn’t exist as a term in the database, Database::get_spelling_suggestion() will be called and if a suggestion is returned, a corrected version of the query string will be built up which can be read using QueryParser::get_corrected_query_string(). The query returned is based on the uncorrected query string however - if you want a parsed query based on the corrected query string, you must call QueryParser::parse_query() again.

NB: You must also call set_database() for this to work.

§

FlagSynonym

Enable synonym operator ‘~’.

NB: You must also call set_database() for this to work.

§

FlagAutoSynonyms

Enable automatic use of synonyms for single terms.

NB: You must also call set_database() for this to work.

§

FlagAutoMultiwordSynonyms

Enable automatic use of synonyms for single terms and groups of terms.

NB: You must also call set_database() for this to work.

§

FlagDefault

The default flags.

Used if you don’t explicitly pass any to @a parse_query(). The default flags are FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE.

Added in Xapian 1.0.11.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.