xapian-core  1.4.25
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Terms Class Reference

Some terms which form a positional sub-query. More...

+ Collaboration diagram for Terms:

Public Member Functions

 ~Terms ()
 
void add_positional_term (Term *term)
 Add an unstemmed Term object to this Terms object. More...
 
void adjust_window (size_t alternative_window)
 
Queryas_phrase_query () const
 Convert to a Xapian::Query * using adjacent OP_PHRASE. More...
 
Queryas_near_query () const
 Convert to a Xapian::Query * using OP_NEAR. More...
 
Queryas_adj_query () const
 Convert to a Xapian::Query * using OP_PHRASE to implement ADJ. More...
 

Static Public Member Functions

static Termscreate (State *state)
 Factory function - ensures heap allocation. More...
 

Private Member Functions

Query opwindow_subq (Query::op op, const vector< Query > &v, Xapian::termcount w) const
 
Queryas_opwindow_query (Query::op op, Xapian::termcount w_delta) const
 Convert to a query using the given operator and window size. More...
 
 Terms (bool no_pos)
 

Private Attributes

vector< Term * > terms
 
size_t window
 Window size. More...
 
bool uniform_prefixes
 Keep track of whether the terms added all have the same list of prefixes. More...
 
const vector< string > * prefixes
 The list of prefixes of the terms added. More...
 

Detailed Description

Some terms which form a positional sub-query.

Definition at line 1058 of file queryparser_internal.cc.

Constructor & Destructor Documentation

◆ Terms()

Terms::Terms ( bool  no_pos)
inlineexplicitprivate

Definition at line 1123 of file queryparser_internal.cc.

◆ ~Terms()

Terms::~Terms ( )
inline

Definition at line 1134 of file queryparser_internal.cc.

Member Function Documentation

◆ add_positional_term()

void Terms::add_positional_term ( Term term)
inline

Add an unstemmed Term object to this Terms object.

Definition at line 1141 of file queryparser_internal.cc.

References Term::field_info, Term::need_positions(), and FieldInfo::prefixes.

Referenced by Term::as_positional_unbroken(), and yy_reduce().

◆ adjust_window()

void Terms::adjust_window ( size_t  alternative_window)
inline

Definition at line 1155 of file queryparser_internal.cc.

Referenced by yy_reduce().

◆ as_adj_query()

Query* Terms::as_adj_query ( ) const
inline

Convert to a Xapian::Query * using OP_PHRASE to implement ADJ.

Definition at line 1175 of file queryparser_internal.cc.

Referenced by yy_reduce().

◆ as_near_query()

Query* Terms::as_near_query ( ) const
inline

Convert to a Xapian::Query * using OP_NEAR.

Definition at line 1165 of file queryparser_internal.cc.

Referenced by yy_reduce().

◆ as_opwindow_query()

Query* Terms::as_opwindow_query ( Query::op  op,
Xapian::termcount  w_delta 
) const
inlineprivate

Convert to a query using the given operator and window size.

Definition at line 1094 of file queryparser_internal.cc.

References add_to_query().

◆ as_phrase_query()

Query* Terms::as_phrase_query ( ) const
inline

Convert to a Xapian::Query * using adjacent OP_PHRASE.

Definition at line 1160 of file queryparser_internal.cc.

Referenced by yy_reduce().

◆ create()

static Terms* Terms::create ( State state)
inlinestatic

Factory function - ensures heap allocation.

Definition at line 1130 of file queryparser_internal.cc.

References State::flags.

Referenced by yy_reduce().

◆ opwindow_subq()

Query Terms::opwindow_subq ( Query::op  op,
const vector< Query > &  v,
Xapian::termcount  w 
) const
inlineprivate

Definition at line 1084 of file queryparser_internal.cc.

Member Data Documentation

◆ prefixes

const vector<string>* Terms::prefixes
private

The list of prefixes of the terms added.

This will be NULL if the terms have different prefixes.

Definition at line 1082 of file queryparser_internal.cc.

◆ terms

vector<Term *> Terms::terms
private

Definition at line 1059 of file queryparser_internal.cc.

◆ uniform_prefixes

bool Terms::uniform_prefixes
private

Keep track of whether the terms added all have the same list of prefixes.

If so, we'll build a set of phrases, one using each prefix. This works around the limitation that a phrase cannot have multiple components which are "OR" combinations of terms, but is also probably what users expect: i.e., if a user specifies a phrase in a field, and that field maps to multiple prefixes, the user probably wants a phrase returned with all terms having one of those prefixes, rather than a phrase comprised of terms with differing prefixes.

Definition at line 1077 of file queryparser_internal.cc.

◆ window

size_t Terms::window
private

Window size.

size_t(-1) means don't use positional info (so an OP_AND query gets created).

Definition at line 1066 of file queryparser_internal.cc.


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