CirrusSearch
Elasticsearch-powered search for MediaWiki
Loading...
Searching...
No Matches
CirrusSearch\Parser\BasicQueryClassifier Class Reference

Basic classifier to identify queries like: More...

+ Inheritance diagram for CirrusSearch\Parser\BasicQueryClassifier:
+ Collaboration diagram for CirrusSearch\Parser\BasicQueryClassifier:

Public Member Functions

 classify (ParsedQuery $query)
 
 visitWordsQueryNode (WordsQueryNode $node)
 
 visitPhraseQueryNode (PhraseQueryNode $node)
 
 visitPhrasePrefixNode (PhrasePrefixNode $node)
 
 visitFuzzyNode (FuzzyNode $node)
 
 visitPrefixNode (PrefixNode $node)
 
 visitWildcardNode (WildcardNode $node)
 
 visitEmptyQueryNode (EmptyQueryNode $node)
 
 visitKeywordFeatureNode (KeywordFeatureNode $node)
 
 visitParsedBooleanNode (ParsedBooleanNode $node)
 
 visitBooleanClause (BooleanClause $clause)
 
 visitNegatedNode (NegatedNode $node)
 
 classes ()
 
 visitNamespaceHeader (NamespaceHeaderNode $node)
 

Public Attributes

const SIMPLE_BAG_OF_WORDS = 'simple_bag_of_words'
 The simplest query ever: only words.
 
const SIMPLE_PHRASE = 'simple_phrase_query'
 Only quoted words.
 
const BAG_OF_WORDS_WITH_PHRASE = 'bag_of_words_with_phrase_query'
 A simple bag of words query with some quoted words.
 
const COMPLEX_QUERY = 'complex_query'
 Expert: a query that uses some special syntax such as:
 
const BOGUS_QUERY = 'bogus_query'
 Query that was fixed/corrected.
 

Detailed Description

Basic classifier to identify queries like:

  • simple words: foo bar
  • simple phrase: "foo bar"
  • simple words + simple phrase; foo "bar baz"
  • complex: any queries that use a keyword, or any non trivial features
  • bogus queries: queries where a bogus pattern have been identified at parse time

Member Function Documentation

◆ classes()

CirrusSearch\Parser\BasicQueryClassifier::classes ( )
Returns
string[]

Implements CirrusSearch\Parser\ParsedQueryClassifier.

◆ classify()

CirrusSearch\Parser\BasicQueryClassifier::classify ( ParsedQuery $query)
Parameters
ParsedQuery$query
Returns
string[]

Implements CirrusSearch\Parser\ParsedQueryClassifier.

◆ visitBooleanClause()

CirrusSearch\Parser\BasicQueryClassifier::visitBooleanClause ( BooleanClause $clause)
Parameters
BooleanClause$clause

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitEmptyQueryNode()

CirrusSearch\Parser\BasicQueryClassifier::visitEmptyQueryNode ( EmptyQueryNode $node)
Parameters
EmptyQueryNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitFuzzyNode()

CirrusSearch\Parser\BasicQueryClassifier::visitFuzzyNode ( FuzzyNode $node)
Parameters
FuzzyNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitKeywordFeatureNode()

CirrusSearch\Parser\BasicQueryClassifier::visitKeywordFeatureNode ( KeywordFeatureNode $node)
Parameters
KeywordFeatureNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitNamespaceHeader()

CirrusSearch\Parser\BasicQueryClassifier::visitNamespaceHeader ( NamespaceHeaderNode $node)
Parameters
NamespaceHeaderNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitNegatedNode()

CirrusSearch\Parser\BasicQueryClassifier::visitNegatedNode ( NegatedNode $node)
Parameters
NegatedNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitParsedBooleanNode()

CirrusSearch\Parser\BasicQueryClassifier::visitParsedBooleanNode ( ParsedBooleanNode $node)
Parameters
ParsedBooleanNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitPhrasePrefixNode()

CirrusSearch\Parser\BasicQueryClassifier::visitPhrasePrefixNode ( PhrasePrefixNode $node)
Parameters
PhrasePrefixNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitPhraseQueryNode()

CirrusSearch\Parser\BasicQueryClassifier::visitPhraseQueryNode ( PhraseQueryNode $node)
Parameters
PhraseQueryNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitPrefixNode()

CirrusSearch\Parser\BasicQueryClassifier::visitPrefixNode ( PrefixNode $node)
Parameters
PrefixNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitWildcardNode()

CirrusSearch\Parser\BasicQueryClassifier::visitWildcardNode ( WildcardNode $node)
Parameters
WildcardNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

◆ visitWordsQueryNode()

CirrusSearch\Parser\BasicQueryClassifier::visitWordsQueryNode ( WordsQueryNode $node)
Parameters
WordsQueryNode$node

Implements CirrusSearch\Parser\AST\Visitor\Visitor.

Member Data Documentation

◆ COMPLEX_QUERY

const CirrusSearch\Parser\BasicQueryClassifier::COMPLEX_QUERY = 'complex_query'

Expert: a query that uses some special syntax such as:

  • wildcards/fuzzy/word prefix
  • explicit boolean expression
  • complex phrase (phrase prefix, non default slop)

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