search::xapian::positioniterator(3pm) [debian man page]
Xapian::PositionIterator(3pm) User Contributed Perl Documentation Xapian::PositionIterator(3pm)NAME
Search::Xapian::PositionIterator - Iterate over sets of positions.
DESCRIPTION
This iterator represents a stream of positions for a term. It overloads "++" for advancing the iterator, or you can explicitly call the
"inc" method. This class also overloads "eq", "ne", "==", "!=", "" (stringification) and "0+" (conversion to an integer).
METHODS
new Constructor. Defaults to an uninitialized iterator.
clone
inc Advance the iterator by one. (Called implictly by "++" overloading).
skip_to <termpos>
Skip the iterator to term position termpos, or the first term position after termpos if termpos isn't in the list of term positions
being iterated.
equal <term>
Checks if a term is the same as this term. Also overloaded to the "eq" and "==" operators.
nequal <term>
Checks if a term is different from this term. Also overloaded to the "ne" and "!=" operators.
get_termpos
Return the term position the iterator is currently on. Also implemented as conversion to an integer.
get_description
Return a description of this object. Also implemented as stringification.
SEE ALSO
Search::Xapian,Search::Xapian::Document
perl v5.14.2 2012-05-09 Xapian::PositionIterator(3pm)
Check Out this Related Man Page
Xapian::QueryParser(3pm) User Contributed Perl Documentation Xapian::QueryParser(3pm)NAME
Search::Xapian::QueryParser - Parse a query string into a Search::Xapian::Query object
DESCRIPTION
This module turns a human readable string into something Xapian can understand. The syntax supported is designed to be similar to other
web based search engines, so that users familiar with them don't have to learn a whole new syntax.
SYNOPSIS
use Search::Xapian qw/:standard/;
my $qp = new Search::Xapian::QueryParser( [$database] );
$qp->set_stemmer(new Search::Xapian::Stem("english"));
$qp->set_default_op(OP_AND);
$database->enquire($qp->parse_query('a NEAR word OR "a phrase" NOT (too difficult) +eh'));
METHODS
new <database>
QueryParser constructor.
set_stemmer <stemmer>
Set the Search::Xapian::Stem object to be used for stemming query terms.
set_stemming_strategy <strategy>
Set the stemming strategy. Valid values are "STEM_ALL", "STEM_SOME", "STEM_NONE".
set_stopper <stopper>
Set the Search::Xapian::Stopper object to be used for identifying stopwords.
set_default_op <operator>
Set the default operator.
This operator is used to combine non-filter query items when no explicit operator is used.
The most useful values for this are OP_OR (the default) and OP_AND. OP_NEAR and OP_PHRASE can also be useful.
See Search::Xapian for descriptions of these constants.
get_default_op
Returns the current default operator.
set_database <database>
Pass a Search::Xapian::Database object which is used to check whether terms exist in some situations.
parse_query <query_string> [<flags>]
Parses the query string according to the rules defined in the query parser documentation below. You can specify certain flags to modify
the searching behaviour:
FLAG_BOOLEAN, FLAG_PHRASE, FLAG_LOVEHATE, FLAG_BOOLEAN_ANY_CASE,
FLAG_WILDCARD, FLAG_PURE_NOT, FLAG_PARTIAL, FLAG_SPELLING_CORRECTION,
FLAG_SYNONYM, FLAG_AUTO_SYNONYMS, FLAG_AUTO_MULTIWORD_SYNONYMS
To specify multiple flags, "bitwise or" them together (with "|"). The default flags are "FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE"
add_prefix <field> <prefix>
Add a probabilistic term prefix. E.g. $qp->add_prefix("author", "A");
Allows the user to search for author:orwell which will search for the term "Aorwel" (assuming English stemming is in use). Multiple
fields can be mapped to the same prefix (so you can e.g. make title: and subject: aliases for each other).
Parameters: field The user visible field name prefix The term prefix to map this to
add_boolean_prefix <field> prefix
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in the free text query. E.g.
$p->add_boolean_prefix("site", "H");
Allows the user to restrict a search with site:xapian.org which will be converted to Hxapian.org combined with any probabilistic query
with "OP_FILTER".
Multiple fields can be mapped to the same prefix (so you can e.g. make site: and domain: aliases for each other).
Parameters: field The user visible field name prefix The term prefix to map this to
stoplist_begin
stoplist_end
unstem_begin
unstem_end
get_description
Returns a string describing this object.
get_corrected_query_string
Get the spelling-corrected query string.
This will only be set if FLAG_SPELLING_CORRECTION is specified when QueryParser::parse_query() was last called.
If there were no corrections, an empty string is returned.
set_max_wildcard_expansion <limit>
Specify the maximum expansion of a wildcard term.
Note: you must also set FLAG_WILDCARD for wildcard expansion to happen.
Parameter limit is the maximum number of terms each wildcard in the query can expand to, or 0 for no limit (which is the default).
REFERENCE
http://www.xapian.org/docs/queryparser.html
http://www.xapian.org/docs/sourcedoc/html/classXapian_1_1QueryParser.html
perl v5.14.2 2012-05-09 Xapian::QueryParser(3pm)