Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Pike Module Reference:

module version 1.2, prepared

  MODULE Public
Modules
Xapian

  MODULE Public.Xapian
Classes
BM25Weight
BoolWeight
Database
Document
ESet
ESetIterator
Enquire
MSet
MSetIterator
PositionIterator
Query
QueryParser
RSet
SimpleStopper
Stem
Stopper
TermIterator
TradWeight
ValueIterator
Weight
WriteableDatabase

Description

An interface to the Xapian full text engine.

For details, please see http://www.xapian.org

  CLASS Public.Xapian.Weight
Methods
destroy()
get_maxextra()
get_maxpart()
get_sumextra()
get_sumpart()
get_sumpart_needs_doclength()
name()
serialise()

Method get_sumpart_needs_doclength

int Public.Xapian.Weight()->get_sumpart_needs_doclength()

Description

returns false if the weight object doesn't need doclength

Returns

Method get_maxpart

float Public.Xapian.Weight()->get_maxpart()

Description

Gets the maximum value that get_sumpart() may return.

This is used in optimising searches, by having the postlist tree decay appropriately when parts of it can have limited, or no, further effect.

Returns

Method get_maxextra

float Public.Xapian.Weight()->get_maxextra()

Description

Gets the maximum value that get_sumextra() may return.

This is used in optimising searches.

Returns

Method get_sumextra

float Public.Xapian.Weight()->get_sumextra(int len)

Description

Get an extra weight for a document to add to the sum calculated over the query terms.

This returns a weight for a given document, and is used by some weighting schemes to account for influence such as document length.

Parameter len

the (unnormalised) document length.

Returns

Method get_sumpart

float Public.Xapian.Weight()->get_sumpart(int wdf, int len)

Description

Get a weight which is part of the sum over terms being performed.

This returns a weight for a given term and document. These weights are summed to give a total weight for the document.

Parameter wdf

the within document frequency of the term.

Parameter len

the (unnormalised) document length.

Returns

Method serialise

string Public.Xapian.Weight()->serialise()

Description

Serialise object parameters into a string.

Returns

Method name

string Public.Xapian.Weight()->name()

Description

Name of the weighting scheme.

If the subclass is called FooWeight, this should return "Foo".

Returns

Method destroy

void Public.Xapian.Weight()->destroy()

  CLASS Public.Xapian.BM25Weight
Description

BM25 weighting scheme.


Inherit Weight

  • Weight
  •   CLASS Public.Xapian.BoolWeight
    Description

    Boolean weighting scheme (everything gets 0).


    Inherit Weight

  • Weight
  •   CLASS Public.Xapian.TradWeight
    Description

    Traditional probabilistic weighting scheme.

    This class implements the Traditional Probabilistic Weighting scheme, as described by the early papers on Probabilistic Retrieval. BM25Weight generally gives better results.


    Inherit Weight

  • Weight
  •   CLASS Public.Xapian.Stopper
    Methods
    `()()
    destroy()
    get_description()
    Description

    Base class for stop-word decision functor.


    Method `()

    int Public.Xapian.Stopper()->`()(string word)

    Description

    Is term a stop-word?

    Returns

    1 if true, 0 otherwise.


    Method get_description

    string Public.Xapian.Stopper()->get_description()

    Returns

    Method destroy

    void Public.Xapian.Stopper()->destroy()

      CLASS Public.Xapian.SimpleStopper
    Methods
    add()
    Description

    Simple implementation of Stopper class - this will suit most users.


    Inherit Stopper

  • Stopper

  • Method add

    void Public.Xapian.SimpleStopper()->add(string word)

    Description

    Add a single stop word.

      CLASS Public.Xapian.Stem
    Methods
    `()()
    create()
    create()
    destroy()
    get_description()
    Description

    Class representing a stemming algorithm.


    Method create

    void Public.Xapian.Stem()->create(string language)

    Description

    Construct a Stem object for a particular language.

    Parameter language

    Either the English name for the language or the two letter ISO639 code.

    The following language names are understood (aliases follow the name):

    * none - don't stem terms * danish (da) * dutch (nl) * english (en) - Martin Porter's 2002 revision of his stemmer * english_lovins (lovins) - Lovin's stemmer * english_porter (porter) - Porter's stemmer as described in his 1980 paper * finnish (fi) * french (fr) * german (de) * italian (it) * norwegian (no) * portuguese (pt) * russian (ru) * spanish (es) * swedish (sv)

    an error will be thrown if the specified language is unknown.


    Method create

    void Public.Xapian.Stem()->create()


    Method `()

    string Public.Xapian.Stem()->`()(string word)

    Description

    stem a word

    Parameter word

    word to be stemmed

    Returns

    the word stem


    Method get_description

    string Public.Xapian.Stem()->get_description()

    Returns

    Method destroy

    void Public.Xapian.Stem()->destroy()

      CLASS Public.Xapian.Query
    Methods
    create()
    create()
    create()
    create()
    create()
    empty()
    get_description()
    get_length()
    Description

    Class representing a query.

    Queries are represented as a tree of objects.


    Method create

    void Public.Xapian.Query()->create()

    Description

    Default constructor: makes an empty query which matches no documents.

    Also useful for defining a Query object to be assigned to later.

    Note

    An exception will be thrown if an attempt is made to use an undefined query when building up a composite query.


    Method create

    void Public.Xapian.Query()->create(string term, int wqf, int pos)

    Description

    A query consisting of a single term.


    Method create

    void Public.Xapian.Query()->create(int op, string left, string right)

    Description

    A query consisting of two terms, opp-ed together.


    Method create

    void Public.Xapian.Query()->create(int op, object left, object right)

    Description

    A query consisting of two subqueries, opp-ed together.


    Method create

    void Public.Xapian.Query()->create(int op, object(Query) query)

    Description

    Apply the specified operator to a single Query object, with a double parameter.


    Method get_length

    int Public.Xapian.Query()->get_length()

    Description

    Get the length of the query, used by some ranking formulae.

    This value is calculated automatically - if you want to override it you can pass a different value to Enquire.set_query().

    Returns

    Method empty

    int Public.Xapian.Query()->empty()

    Description

    Test if the query is empty (i.e. was constructed using the default constructor).

    Returns

    Method get_description

    string Public.Xapian.Query()->get_description()

    Returns

    Constant OP_AND

    constant Public.Xapian.Query()->OP_AND

    Description

    Return iff both subqueries are satisfied.


    Constant OP_OR

    constant Public.Xapian.Query()->OP_OR

    Description

    Return if either subquery is satisfied.


    Constant OP_AND_NOT

    constant Public.Xapian.Query()->OP_AND_NOT

    Description

    Return if left but not right satisfied.


    Constant OP_XOR

    constant Public.Xapian.Query()->OP_XOR

    Description

    Return if one query satisfied, but not both.


    Constant OP_AND_MAYBE

    constant Public.Xapian.Query()->OP_AND_MAYBE

    Description

    Return iff left satisfied, but use weights from both.


    Constant OP_FILTER

    constant Public.Xapian.Query()->OP_FILTER

    Description

    As AND, but use only weights from left subquery.


    Constant OP_NEAR

    constant Public.Xapian.Query()->OP_NEAR

    Description

    Find occurrences of a list of terms with all the terms occurring within a specified window of positions.

    Each occurrence of a term must be at a different position, but the order they appear in is irrelevant.

    The window parameter should be specified for this operation, but will default to the number of terms in the list.


    Constant OP_PHRASE

    constant Public.Xapian.Query()->OP_PHRASE

    Description

    Find occurrences of a list of terms with all the terms occurring within a specified window of positions, and all the terms appearing in the order specified.

    Each occurrence of a term must be at a different position.

    The window parameter should be specified for this operation, but will default to the number of terms in the list.


    Constant OP_ELITE_SET

    constant Public.Xapian.Query()->OP_ELITE_SET

    Description

    Select an elite set from the subqueries, and perform a query with these combined as an OR query.


    Constant OP_VALUE_RANGE

    constant Public.Xapian.Query()->OP_VALUE_RANGE

    Description

    Filter by a range test on a document value.


    Constant OP_SCALE_WEIGHT

    constant Public.Xapian.Query()->OP_SCALE_WEIGHT

    Description

    Scale the weight of a subquery by the specified factor.

    A factor of 0 means this subquery will contribute no weight to the query - it will act as a purely boolean subquery.

    If the factor is negative, an error will be thrown.

      CLASS Public.Xapian.PositionIterator
    Methods
    get_description()
    get_position()
    skip_to()

    Method skip_to

    void Public.Xapian.PositionIterator()->skip_to(int pos)

    Returns

    Method get_position

    int Public.Xapian.PositionIterator()->get_position()

    Returns

    Method get_description

    string Public.Xapian.PositionIterator()->get_description()

    Returns
      CLASS Public.Xapian.ValueIterator
    Methods
    get_description()
    get_value()
    get_valueno()

    Method get_valueno

    int Public.Xapian.ValueIterator()->get_valueno()

    Returns

    Method get_value

    int Public.Xapian.ValueIterator()->get_value()

    Returns

    Method get_description

    string Public.Xapian.ValueIterator()->get_description()

    Returns
      CLASS Public.Xapian.TermIterator
    Methods
    get_description()
    get_term()
    get_termfreq()
    get_wdf()
    position_iterator()
    positionlist_count()

    Method position_iterator

    object Public.Xapian.TermIterator()->position_iterator()

    Returns

    an object which can be passed to foreach()


    Method get_wdf

    int Public.Xapian.TermIterator()->get_wdf()

    Returns

    Method get_termfreq

    int Public.Xapian.TermIterator()->get_termfreq()

    Returns

    Method positionlist_count

    int Public.Xapian.TermIterator()->positionlist_count()

    Returns

    Method get_term

    string Public.Xapian.TermIterator()->get_term()

    Returns

    Method get_description

    string Public.Xapian.TermIterator()->get_description()

    Returns
      CLASS Public.Xapian.Document
    Methods
    add_posting()
    add_term()
    add_value()
    clear_terms()
    clear_values()
    create()
    get_data()
    get_description()
    get_value()
    remove_posting()
    remove_term()
    remove_value()
    set_data()
    term_iterator()
    termlist_count()
    value_iterator()
    values_count()
    Description

    A document in the database - holds data, values, terms, and postings.


    Method create

    void Public.Xapian.Document()->create()


    Method set_data

    void Public.Xapian.Document()->set_data(string data)

    Description

    Set data stored in the document.


    Method value_iterator

    object(ValueIterator) Public.Xapian.Document()->value_iterator()

    Description

    Get an iterator for the values in this document.

    Returns

    a ValueIterator object which can be passed to foreach()


    Method term_iterator

    object(TermIterator) Public.Xapian.Document()->term_iterator()

    Description

    Get an iterator for the terms in this document.

    Returns

    a TermIterator object which can be passed to foreach()


    Method clear_terms

    void Public.Xapian.Document()->clear_terms()

    Description

    Remove all terms (and postings) from the document.


    Method clear_values

    void Public.Xapian.Document()->clear_values()

    Description

    Remove all values associated with the document.


    Method get_data

    string Public.Xapian.Document()->get_data()

    Description

    Get data stored in the document. This is a potentially expensive operation, and shouldn't normally be used in a match decider function. Put data for use by match deciders in a value instead.

    Returns

    Method get_description

    string Public.Xapian.Document()->get_description()

    Returns

    Method get_value

    string Public.Xapian.Document()->get_value(int val)

    Description

    Get value by number.

    Parameter val

    The number of the value.

    Returns

    Returns an empty string if no value with the given number is present in the document.


    Method remove_value

    void Public.Xapian.Document()->remove_value(int val)

    Description

    Remove any value with the given number.


    Method add_term

    void Public.Xapian.Document()->add_term(string tname, int termcount)

    Description

    Add a term to the document, without positional information.

    Any existing positional information for the term will be left unmodified.

    Parameter tname

    The name of the term.

    Parameter termcount

    The increment that will be applied to the wdf for this term.


    Method add_posting

    void Public.Xapian.Document()->add_posting(string tname, int termpos, int termcount)

    Description

    Add an occurrence of a term at a particular position.

    Multiple occurrences of the term at the same position are represented only once in the positional information, but do increase the wdf.

    If the term is not already in the document, it will be added to it.

    Parameter tname

    The name of the term.

    Parameter termpos

    The position of the term.

    Parameter termcount

    The increment that will be applied to the wdf for this term.


    Method remove_term

    void Public.Xapian.Document()->remove_term(string tname)

    Description

    Remove a term and all postings associated with it.

    Parameter tname

    The name of the term.

    An error will be thrown if the term is not present in the document.


    Method remove_posting

    void Public.Xapian.Document()->remove_posting(string tname, int tpos, int wdfdec)

    Description

    Remove a posting of a term from the document.

    Note that the term will still index the document even if all occurrences are removed. To remove a term from a document completely, use remove_term().

    Parameter tname

    The name of the term.

    Parameter tpos

    The position of the term.

    Parameter wdfdec

    The decrement that will be applied to the wdf when removing this posting. The wdf will not go below the value of 0.

    Note

    An error will be thrown if the term is not at the position specified in the position list for this term in this document or if the term is not in the document.


    Method add_value

    void Public.Xapian.Document()->add_value(int valueno, string value)

    Description

    Add a new value.

    It will replace any existing value with the same number.


    Method termlist_count

    int Public.Xapian.Document()->termlist_count()

    Description

    Count the terms in this document.

    Returns

    the number of terms in the document.


    Method values_count

    int Public.Xapian.Document()->values_count()

    Description

    Count the values in this document.

    Returns

    the number of values in the document.

      CLASS Public.Xapian.MSetIterator
      CLASS Public.Xapian.ESetIterator
      CLASS Public.Xapian.MSet
    Methods
    back()
    begin()
    create()
    end()
    fetch()
    get_description()
    get_firstitem()
    get_matches_estimated()
    get_matches_lower_bound()
    get_matches_upper_bound()
    size()

    Method create

    void Public.Xapian.MSet()->create()


    Method begin

    object Public.Xapian.MSet()->begin()

    Returns

    Method end

    object Public.Xapian.MSet()->end()

    Returns

    Method back

    object Public.Xapian.MSet()->back()

    Returns

    Method fetch

    void Public.Xapian.MSet()->fetch()


    Method size

    int Public.Xapian.MSet()->size()

    Returns

    Method get_matches_estimated

    int Public.Xapian.MSet()->get_matches_estimated()

    Returns

    Method get_matches_upper_bound

    int Public.Xapian.MSet()->get_matches_upper_bound()

    Returns

    Method get_firstitem

    int Public.Xapian.MSet()->get_firstitem()

    Returns

    Method get_matches_lower_bound

    int Public.Xapian.MSet()->get_matches_lower_bound()

    Returns

    Method get_description

    string Public.Xapian.MSet()->get_description()

    Returns
      CLASS Public.Xapian.RSet
    Methods
    add_document()
    add_document()
    contains()
    contains()
    create()
    empty()
    get_description()
    remove_document()
    remove_document()
    size()

    Method create

    void Public.Xapian.RSet()->create()


    Method size

    int Public.Xapian.RSet()->size()

    Returns

    Method empty

    int Public.Xapian.RSet()->empty()

    Returns

    Method add_document

    void Public.Xapian.RSet()->add_document(int docid)


    Method add_document

    void Public.Xapian.RSet()->add_document(object iterator)


    Method remove_document

    void Public.Xapian.RSet()->remove_document(int docid)


    Method remove_document

    void Public.Xapian.RSet()->remove_document(object iterator)


    Method contains

    int Public.Xapian.RSet()->contains(int docid)

    Returns

    Method contains

    int Public.Xapian.RSet()->contains(object iterator)

    Returns

    Method get_description

    string Public.Xapian.RSet()->get_description()

    Returns
      CLASS Public.Xapian.ESet
    Methods
    `[]()
    back()
    begin()
    create()
    empty()
    end()
    get_description()
    get_ebound()
    max_size()
    size()

    Method create

    void Public.Xapian.ESet()->create()


    Method begin

    object Public.Xapian.ESet()->begin()

    Returns

    Method end

    object Public.Xapian.ESet()->end()

    Returns

    Method back

    object Public.Xapian.ESet()->back()

    Returns

    Method `[]

    object Public.Xapian.ESet()->`[](int i)

    Returns

    Method size

    int Public.Xapian.ESet()->size()

    Returns

    Method empty

    int Public.Xapian.ESet()->empty()

    Returns

    Method max_size

    int Public.Xapian.ESet()->max_size()

    Returns

    Method get_ebound

    int Public.Xapian.ESet()->get_ebound()

    Returns

    Method get_description

    string Public.Xapian.ESet()->get_description()

    Returns
      CLASS Public.Xapian.QueryParser
    Methods
    add_boolean_prefix()
    add_prefix()
    create()
    get_description()
    parse_query()
    set_default_op()
    set_stemmer()
    set_stopper()

    Method create

    void Public.Xapian.QueryParser()->create()


    Method set_stemmer

    void Public.Xapian.QueryParser()->set_stemmer(object stemmer)


    Method set_stopper

    void Public.Xapian.QueryParser()->set_stopper(object stopper)


    Method set_default_op

    void Public.Xapian.QueryParser()->set_default_op(int op)


    Method parse_query

    object Public.Xapian.QueryParser()->parse_query(string query, int flags)

    Returns

    Method add_prefix

    void Public.Xapian.QueryParser()->add_prefix(string field, string prefix)


    Method add_boolean_prefix

    void Public.Xapian.QueryParser()->add_boolean_prefix(string field, string prefix)


    Method get_description

    string Public.Xapian.QueryParser()->get_description()

    Returns
      CLASS Public.Xapian.Database
    Methods
    create()
    create()
    destroy()
    get_avlength()
    get_description()
    get_doccount()
    get_doclength()
    get_document()
    get_lastdocid()
    has_positions()
    keep_alive()
    reopen()

    Method create

    void Public.Xapian.Database()->create(string path)


    Method create

    void Public.Xapian.Database()->create()


    Method reopen

    void Public.Xapian.Database()->reopen()


    Method keep_alive

    void Public.Xapian.Database()->keep_alive()


    Method get_doclength

    int Public.Xapian.Database()->get_doclength(int did)

    Returns

    Method get_doccount

    int Public.Xapian.Database()->get_doccount()

    Returns

    Method get_avlength

    int Public.Xapian.Database()->get_avlength()

    Returns

    Method get_lastdocid

    int Public.Xapian.Database()->get_lastdocid()

    Returns

    Method has_positions

    int Public.Xapian.Database()->has_positions()

    Returns

    Method get_document

    object Public.Xapian.Database()->get_document(int id)

    Returns

    Method get_description

    string Public.Xapian.Database()->get_description()

    Returns

    Method destroy

    void Public.Xapian.Database()->destroy()

      CLASS Public.Xapian.WriteableDatabase
    Methods
    add_document()
    begin_transaction()
    cancel_transaction()
    commit_transaction()
    create()
    delete_document()
    delete_document()
    flush()
    get_description()
    replace_document()
    replace_document()

    Inherit Database

  • Database

  • Method create

    void Public.Xapian.WriteableDatabase()->create(string path, int mode)


    Method flush

    void Public.Xapian.WriteableDatabase()->flush()


    Method add_document

    int Public.Xapian.WriteableDatabase()->add_document(object document)

    Returns

    Method replace_document

    void Public.Xapian.WriteableDatabase()->replace_document(int did, object document)


    Method replace_document

    void Public.Xapian.WriteableDatabase()->replace_document(string term, object document)


    Method delete_document

    void Public.Xapian.WriteableDatabase()->delete_document(string unique_term)


    Method delete_document

    void Public.Xapian.WriteableDatabase()->delete_document(int did)


    Method begin_transaction

    void Public.Xapian.WriteableDatabase()->begin_transaction(int flushed)


    Method commit_transaction

    void Public.Xapian.WriteableDatabase()->commit_transaction()


    Method cancel_transaction

    void Public.Xapian.WriteableDatabase()->cancel_transaction()


    Method get_description

    string Public.Xapian.WriteableDatabase()->get_description()

    Returns
      CLASS Public.Xapian.Enquire
    Methods
    create()
    get_description()
    get_eset()
    get_eset()
    get_matching_terms()
    get_mset()
    get_mset()
    get_query()
    set_collapse_key()
    set_cutoff()
    set_docid_order()
    set_query()
    set_sort_by_relevance_then_value()
    set_sort_by_relevence()
    set_sort_by_value_then_relevance()
    set_sort_value()
    set_weighting_scheme()

    Method create

    void Public.Xapian.Enquire()->create(object database)


    Method set_weighting_scheme

    void Public.Xapian.Enquire()->set_weighting_scheme(object weight)


    Method set_query

    void Public.Xapian.Enquire()->set_query(object query, int termcount)


    Method set_cutoff

    void Public.Xapian.Enquire()->set_cutoff(int percent_cutoff, float weight_cutoff)


    Method set_docid_order

    void Public.Xapian.Enquire()->set_docid_order(int docid_order)


    Method set_collapse_key

    void Public.Xapian.Enquire()->set_collapse_key(int collapse_key)


    Method set_sort_by_relevance_then_value

    void Public.Xapian.Enquire()->set_sort_by_relevance_then_value(int sort_key, int ascending)


    Method set_sort_by_value_then_relevance

    void Public.Xapian.Enquire()->set_sort_by_value_then_relevance(int sort_key, int ascending)


    Method set_sort_value

    void Public.Xapian.Enquire()->set_sort_value(int sort_key, int ascending)


    Method set_sort_by_relevence

    void Public.Xapian.Enquire()->set_sort_by_relevence()


    Method get_query

    object Public.Xapian.Enquire()->get_query()

    Returns

    Method get_mset

    object Public.Xapian.Enquire()->get_mset(int first, int maxitems, object rset, function mdecider)

    Returns

    Method get_mset

    object Public.Xapian.Enquire()->get_mset(int first, int maxitems, int checkatleast)

    Returns

    Method get_eset

    object Public.Xapian.Enquire()->get_eset(int maxitems, object rset, function edecider)

    Returns

    Method get_eset

    object Public.Xapian.Enquire()->get_eset(int maxitems, object rset, int flags, float k, function edecider)

    Returns

    Method get_matching_terms

    object Public.Xapian.Enquire()->get_matching_terms(int docid)

    Returns

    a TermIterator object which can also be passed to foreach()


    Method get_description

    string Public.Xapian.Enquire()->get_description()

    Returns
    gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University