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

Utilities for dealing with filters. More...

Static Public Member Functions

static booleanOr (array $queries, $matchAll=true)
 Turns a list of queries into a boolean OR, requiring only one of the provided queries to match.
 
static unify (array $mustFilters, array $mustNotFilters)
 Merges lists of include/exclude filters into a single filter that Elasticsearch will execute efficiently.
 
static insource (Escaper $escaper, $value)
 Create a query for insource: queries.
 
static intitle (Escaper $escaper, $value, $plain=false)
 Create a query for intitle: queries.
 

Detailed Description

Utilities for dealing with filters.

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

Member Function Documentation

◆ booleanOr()

static CirrusSearch\Search\Filters::booleanOr ( array $queries,
$matchAll = true )
static

Turns a list of queries into a boolean OR, requiring only one of the provided queries to match.

Parameters
AbstractQuery[]$queries
bool$matchAllWhen true (default) function never returns null, when no queries are provided a MatchAll is returned.
Returns
AbstractQuery|null The resulting OR query. Only returns null when no queries are passed and $matchAll is false.

◆ insource()

static CirrusSearch\Search\Filters::insource ( Escaper $escaper,
$value )
static

Create a query for insource: queries.

This function is pure, deferring state changes to the reference-updating return function.

Parameters
Escaper$escaper
string$value
Returns
AbstractQuery

◆ intitle()

static CirrusSearch\Search\Filters::intitle ( Escaper $escaper,
$value,
$plain = false )
static

Create a query for intitle: queries.

Parameters
Escaper$escaper
string$value
bool$plainOnly search plain fields
Returns
AbstractQuery

◆ unify()

static CirrusSearch\Search\Filters::unify ( array $mustFilters,
array $mustNotFilters )
static

Merges lists of include/exclude filters into a single filter that Elasticsearch will execute efficiently.

Parameters
AbstractQuery[]$mustFiltersfilters that must match all returned documents
AbstractQuery[]$mustNotFiltersfilters that must not match all returned documents
Returns
null|AbstractQuery null if there are no filters or one that will execute all of the provided filters

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