Lucene Query Builder for QPL

From wiki.searchtechnologies.com
Revision as of 17:07, 3 March 2017 by Sdenny (talk | contribs) (Protected "Lucene Query Builder for QPL" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

Enterprise Add-On Feature

This page documents the details of the Lucene Query Builder for QPL.

Legend:

  • Operator = The QPL operator
  • Implemented = Whether or not the QPL operator has been implemented in the builder
  • Fields = Are fielded queries supported?
  • Proximity = Are proximity windows supported?
    • This may be further qualified as to whether the window can be placed directly on the operator, or if the operator is allowed to occur inside an expression which contains a proximity window on an ancestor operator node
  • Boosting = Is boosting / weighted expressions supported?


Operator Implemented Fields Proximity Boosting Implementation Notes
term Yes Yes Yes Yes Standard Query: TermQuery(), WildcardQuery() when query has wild character or MatchAllQuery() when query is *:*

Inside a proximity expression: SpanTermQuery() or SpanMultiTermQueryWrapper()

wildcard Yes Yes Yes Yes Standard Query: WildcardQuery() when query has wild character or MatchAllQuery() when query is *:*

Inside a proximity expression: SpanMultiTermQueryWrapper()

between Yes Yes Yes Yes SpanNearQuery() with order
before Yes Yes Yes Yes Standard Query: BooleanQuery() with MUST clauses

Inside a proximity expression: SpanNearQuery() with order

and (near) Yes Yes Yes Yes Standard Query: BooleanQuery() with MUST clauses

Inside a proximity expression: SpanNearQuery() without order

or Yes Yes Yes Yes Standard Query: BooleanQuery() with SHOULD clauses

Inside a proximity expression: SpanOrQuery()

orMin Yes Yes No Yes BooleanQuery() with SHOULD clauses, and setMinimumNumberShouldMatch() set to the minimum clauses.
max Yes Yes No Yes DisjunctionMaxQuery() with tiebreakers = 0.0
constant Yes Yes No Yes ConstantScoreQuery() with a nested BooleanQuery() (with SHOULD clauses) if there are multiple operands.
boostPlus Yes Yes No Yes BooleanQuery() where first operand is MUST and all other operands are SHOULD
boostMul Yes Yes No Yes BoostingQuery() with a nested BooleanQuery() (with SHOULD clauses) if there are more than 3 arguments.
phrase Yes Yes No Yes Nested phrases are allowed and nested or() expressions are allowed (as long as the contents of all of the nested or()'s are ONLY TERMS.

Uses PhraseQuery() if contents are all TERM or PHRASE. Uses MultiPhraseQuery() if some operands are an or() of terms.

not Yes Yes No n/a For and(not()...), the not is propagated up to the and()'s BooleanQuery as a MUST_NOT clause. This is (by far) the most efficient implementation.

not(not(x)) is optimized to simply 'x'.

All other versions of not are replaced with BooleanQuery() with two clauses: The first is a MatchAllDocsQuery() with MUST, and the second is the not operand with MUST_NOT. For example:

or(not('george'), 'washington') --> (+*:* -text:george) text:washington

WARNING: Using not() within or() expressions will likely be very slow! Use sparingly, if at all.


Meta-Operator Handling

The following methods are automatically converted by the QPL framework into the simpler operators found above.

  • boost() -> Fully Implemented
  • field() -> Fully Implemented
  • compositeOr() -> Fully Implemented
  • compositeMax() -> Fully Implemented