xapian-core  1.4.27
Public Member Functions | Public Attributes | Private Attributes | List of all members
Term Class Reference

Class used to pass information about a token from lexer to parser. More...

+ Collaboration diagram for Term:

Public Member Functions

 Term (const string &name_, termpos pos_)
 
 Term (const string &name_)
 
 Term (const string &name_, const FieldInfo *field_info_)
 
 Term (termpos pos_)
 
 Term (State *state_, const string &name_, const FieldInfo *field_info_, const string &unstemmed_, QueryParser::stem_strategy stem_=QueryParser::STEM_NONE, termpos pos_=0)
 
 Term (const Xapian::Query &q, const string &grouping)
 
string make_term (const string &prefix) const
 
void need_positions ()
 
termpos get_termpos () const
 
string get_grouping () const
 
Queryas_wildcarded_query (State *state) const
 
Queryas_partial_query (State *state_) const
 Build a query for a term at the very end of the query string when FLAG_PARTIAL is in use. More...
 
Queryas_unbroken_query () const
 Build a query for a string of words without explicit word breaks. More...
 
void as_positional_unbroken (Terms *terms) const
 Handle text without explicit word breaks in a positional context. More...
 
Query as_range_query () const
 Range query. More...
 
Query get_query () const
 
Query get_query_with_synonyms () const
 
Query get_query_with_auto_synonyms () const
 

Public Attributes

string name
 
const FieldInfofield_info
 
string unstemmed
 
QueryParser::stem_strategy stem
 
termpos pos
 
Query query
 

Private Attributes

Statestate
 

Detailed Description

Class used to pass information about a token from lexer to parser.

Generally an instance of this class carries term information, but it can be used for a range query, and with some operators (e.g. the distance in NEAR/3 or ADJ/3, etc).

Definition at line 160 of file queryparser_internal.cc.

Constructor & Destructor Documentation

◆ Term() [1/6]

Term::Term ( const string &  name_,
termpos  pos_ 
)
inline

Definition at line 171 of file queryparser_internal.cc.

◆ Term() [2/6]

Term::Term ( const string &  name_)
inlineexplicit

Definition at line 173 of file queryparser_internal.cc.

◆ Term() [3/6]

Term::Term ( const string &  name_,
const FieldInfo field_info_ 
)
inline

Definition at line 175 of file queryparser_internal.cc.

◆ Term() [4/6]

Term::Term ( termpos  pos_)
inlineexplicit

Definition at line 178 of file queryparser_internal.cc.

◆ Term() [5/6]

Term::Term ( State state_,
const string &  name_,
const FieldInfo field_info_,
const string &  unstemmed_,
QueryParser::stem_strategy  stem_ = QueryParser::STEM_NONE,
termpos  pos_ = 0 
)
inline

Definition at line 179 of file queryparser_internal.cc.

◆ Term() [6/6]

Term::Term ( const Xapian::Query q,
const string &  grouping 
)
inline

Definition at line 186 of file queryparser_internal.cc.

Member Function Documentation

◆ as_partial_query()

Query * Term::as_partial_query ( State state_) const

Build a query for a term at the very end of the query string when FLAG_PARTIAL is in use.

This query should match documents containing any terms which start with the characters specified, but should give a higher score to exact matches (since the user might have finished typing - we simply don't know).

Definition at line 516 of file queryparser_internal.cc.

References State::get_max_partial_expansion(), State::get_max_partial_type(), and name.

◆ as_positional_unbroken()

void Term::as_positional_unbroken ( Terms terms) const

Handle text without explicit word breaks in a positional context.

Definition at line 1186 of file queryparser_internal.cc.

References Terms::add_positional_term(), and Xapian::Unicode::append_utf8().

◆ as_range_query()

Query Term::as_range_query ( ) const

Range query.

Definition at line 562 of file queryparser_internal.cc.

References query().

◆ as_unbroken_query()

Query * Term::as_unbroken_query ( ) const

Build a query for a string of words without explicit word breaks.

Definition at line 542 of file queryparser_internal.cc.

◆ as_wildcarded_query()

Query * Term::as_wildcarded_query ( State state) const

◆ get_grouping()

string Term::get_grouping ( ) const
inline

Definition at line 197 of file queryparser_internal.cc.

References FieldInfo::grouping.

◆ get_query()

Query Term::get_query ( ) const

Definition at line 481 of file queryparser_internal.cc.

References Assert, and name.

◆ get_query_with_auto_synonyms()

Query Term::get_query_with_auto_synonyms ( ) const

Definition at line 435 of file queryparser_internal.cc.

◆ get_query_with_synonyms()

Query Term::get_query_with_synonyms ( ) const

◆ get_termpos()

termpos Term::get_termpos ( ) const
inline

Definition at line 195 of file queryparser_internal.cc.

◆ make_term()

string Term::make_term ( const string &  prefix) const

Definition at line 330 of file queryparser_internal.cc.

References name, and prefix_needs_colon().

◆ need_positions()

void Term::need_positions ( )
inline

Definition at line 191 of file queryparser_internal.cc.

Referenced by Terms::add_positional_term().

Member Data Documentation

◆ field_info

const FieldInfo* Term::field_info

Definition at line 165 of file queryparser_internal.cc.

Referenced by Terms::add_positional_term().

◆ name

string Term::name

Definition at line 164 of file queryparser_internal.cc.

Referenced by State::add_to_stoplist(), and State::is_stopword().

◆ pos

termpos Term::pos

Definition at line 168 of file queryparser_internal.cc.

◆ query

Query Term::query

Definition at line 169 of file queryparser_internal.cc.

◆ state

State* Term::state
private

Definition at line 161 of file queryparser_internal.cc.

◆ stem

Definition at line 167 of file queryparser_internal.cc.

◆ unstemmed

string Term::unstemmed

Definition at line 166 of file queryparser_internal.cc.


The documentation for this class was generated from the following file: