CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Search\CirrusSearchIndexFieldFactory Class Reference

Create different types of SearchIndexFields. More...

Public Member Functions

 __construct (SearchConfig $searchConfig)
 
 makeSearchFieldMapping ( $name, $type)
 Create a search field definition.
 
 newStringField ( $fieldName, $options=null, $extra=[])
 Build a string field that does standard analysis for the language.
 
 newLongField ( $name)
 Create a long field.
 
 newKeywordField ( $name)
 Create a long field.
 

Detailed Description

Create different types of SearchIndexFields.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Constructor & Destructor Documentation

◆ __construct()

CirrusSearch\Search\CirrusSearchIndexFieldFactory::__construct ( SearchConfig $searchConfig)
Parameters
SearchConfig$searchConfig

Member Function Documentation

◆ makeSearchFieldMapping()

CirrusSearch\Search\CirrusSearchIndexFieldFactory::makeSearchFieldMapping ( $name,
$type )

Create a search field definition.

Parameters
string$name
string$type
Returns
SearchIndexField

◆ newKeywordField()

CirrusSearch\Search\CirrusSearchIndexFieldFactory::newKeywordField ( $name)

Create a long field.

Parameters
string$nameField name
Returns
KeywordIndexField

◆ newLongField()

CirrusSearch\Search\CirrusSearchIndexFieldFactory::newLongField ( $name)

Create a long field.

Parameters
string$nameField name
Returns
IntegerIndexField

◆ newStringField()

CirrusSearch\Search\CirrusSearchIndexFieldFactory::newStringField ( $fieldName,
$options = null,
$extra = [] )

Build a string field that does standard analysis for the language.

Parameters
string$fieldName
int | null$optionsField options: ENABLE_NORMS: Enable norms on the field. Good for text you search against but bad for array fields and useless for fields that don't get involved in the score. COPY_TO_SUGGEST: Copy the contents of this field to the suggest field for "Did you mean". SPEED_UP_HIGHLIGHTING: Store extra data in the field to speed up highlighting. This is important for long strings or fields with many values.
array$extraExtra analyzers for this field beyond the basic text and plain.
Returns
TextIndexField definition of the field

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