VuFind API Documentation

Spellcheck
in package
implements IteratorAggregate, Countable

SOLR spellcheck information.

Tags
category

VuFind

author

David Maus maus@hab.de

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link
https://vufind.org

Interfaces, Classes, Traits and Enums

IteratorAggregate
Countable

Table of Contents

$query  : string
Spelling query that generated suggestions
$secondary  : Spellcheck
Secondary spelling suggestions (in case merged results are not useful).
$terms  : ArrayObject
Spellcheck terms mapped to term information.
__construct()  : void
Constructor.
compareTermLength()  : int
Compare length of two terms such that terms are sorted by descending length.
count()  : int
Return number of terms.
getIterator()  : Traversable
Return aggregated iterator.
getQuery()  : string
Get spelling query.
getSecondary()  : Spellcheck|bool
Get secondary suggestions (or return false if none exist).
mergeWith()  : void
Merge in other spellcheck information.
contains()  : bool
Return true if we already have information for the term.

Properties

$query

Spelling query that generated suggestions

protected string $query

$secondary

Secondary spelling suggestions (in case merged results are not useful).

protected Spellcheck $secondary = false

$terms

Spellcheck terms mapped to term information.

protected ArrayObject $terms

Methods

__construct()

Constructor.

public __construct(array<string|int, mixed> $spellcheck, string $query) : void
Parameters
$spellcheck : array<string|int, mixed>

SOLR spellcheck information

$query : string

Spelling query that generated suggestions

Return values
void

compareTermLength()

Compare length of two terms such that terms are sorted by descending length.

public compareTermLength(string $a, string $b) : int

This method belongs to the internal API but must be declared public in order to be used for ArrayObject::uksort().

Parameters
$a : string

First term

$b : string

Second term

Tags
see
http://www.php.net/manual/en/arrayobject.uksort.php
Return values
int

count()

Return number of terms.

public count() : int
Return values
int

getIterator()

Return aggregated iterator.

public getIterator() : Traversable
Return values
Traversable

getQuery()

Get spelling query.

public getQuery() : string
Return values
string

getSecondary()

Get secondary suggestions (or return false if none exist).

public getSecondary() : Spellcheck|bool
Return values
Spellcheck|bool

mergeWith()

Merge in other spellcheck information.

public mergeWith(Spellcheck $spellcheck) : void
Parameters
$spellcheck : Spellcheck

Other spellcheck information

Return values
void

contains()

Return true if we already have information for the term.

protected contains(string $term) : bool
Parameters
$term : string

Term to check

Return values
bool

Search results