SilverStripe\Elastica\ElasticaSearcher
Synopsis
class ElasticaSearcher
{
- // members
- private string $classes = '';
- private array $filters = ;
- private $locale = NULL;
- private ElasticaSearchHelper $manipulator;
- private integer $start = 0;
- private integer $pageLength = 10;
- private $aggregations = NULL;
- private array $highlightedFields = ;
- private boolean $showResultsForEmptySearch = false;
- private $SuggestedQuery = NULL;
- private integer $minTermFreq = 2;
- private integer $maxTermFreq = 25;
- private integer $minDocFreq = 2;
- private integer $maxDocFreq = 0;
- private integer $minWordLength = 0;
- private integer $maxWordLength = 0;
- private string $minShouldMatch = '30%';
- private string $similarityStopWords = '';
- // methods
- public void showResultsForEmptySearch()
- public void hideResultsForEmptySearch()
- public bool getShowResultsForEmptySearch()
- public void setClasses()
- public void setQueryResultManipulator()
- public void setStart()
- public void setPageLength()
- public void setLocale()
- public void addFilter()
- public array getAggregations()
- public void setMinTermFreq()
- public void setMaxTermFreq()
- public void setMinDocFreq()
- public void setMaxDocFreq()
- public void setMinWordLength()
- public void setMaxWordLength()
- public void setMinShouldMatch()
- public void setSimilarityStopWords()
- public void setHighlightedFields()
- public PaginatedList search()
- public void autocomplete_search()
- public PaginatedList moreLikeThis()
- public void hasSuggestedQuery()
- public string getSuggestedQuery()
- public void getSuggestedQueryHighlighted()
Members
private
- $SuggestedQuery
- $aggregations
—
array
After a search is performed aggregrations are saved here. - $classes
—
string
Comma separated list of SilverStripe ClassNames to search. Leave blank for all. - $filters
—
array
Array of aggregation selected mapped to the value selected, e.g. 'Aperture' => '11'. - $highlightedFields
—
array
Array of highlighted fields, e.g. Title, Title.standard. If this is empty then the ShowHighlight field of SearchableField is used to determine which fields to highlight. -
$locale
The locale to search, is set to current locale or default locale by default but can be overriden. This is the code in the form en_US, th_TH etc. - $manipulator
—
SilverStripe\Elastica\ElasticaSearchHelper
Object just to manipulate the query and result, used for aggregations. - $maxDocFreq
- $maxTermFreq
- $maxWordLength
- $minDocFreq
- $minShouldMatch
- $minTermFreq
- $minWordLength
- $pageLength
—
int
How many search results to return. - $showResultsForEmptySearch
- $similarityStopWords
- $start
—
int
Offset from zero to return search results from.
Methods
public
- addFilter() — Add a filter to the current query in the form of a key/value pair.
- autocomplete_search()
- getAggregations() — Accessor to the aggregations, to be used after a search.
- getShowResultsForEmptySearch() — Accessor the variable to determine whether or not to show results for an empty search.
- getSuggestedQuery()
- getSuggestedQueryHighlighted()
- hasSuggestedQuery()
- hideResultsForEmptySearch()
- moreLikeThis() — Perform a 'More Like This' search, aka relevance feedback, using the provided indexed DataObject.
- search() — Search against elastica using the criteria already provided, such as page length, start, and of course the filters.
- setClasses() — Update the list of Classes to search, use SilverStripe ClassName comma separated.
- setHighlightedFields()
- setLocale() — Set a new locale.
- setMaxDocFreq() — Set the maximum number of documents a term can reside in for consideration as part of the input query.
- setMaxTermFreq() — Set the maximum term frequency for term to be considered in input query.
- setMaxWordLength() — Set the maximum word length for a term to be considered part of the query.
- setMinDocFreq() — Set the minimum number of documents a term can reside in for consideration as part of the input query.
- setMinShouldMatch()
- setMinTermFreq() — Set the minimum term frequency for term to be considered in input query.
- setMinWordLength() — Set the minimum word length for a term to be considered part of the query.
- setPageLength() — Update the page length variable.
- setQueryResultManipulator() — Set the manipulator, mainly used for aggregation.
- setSimilarityStopWords()
- setStart() — Update the start variable.
- showResultsForEmptySearch()