Operator Types

From wiki.searchtechnologies.com
Revision as of 17:08, 3 March 2017 by Sdenny (talk | contribs) (Protected "Operator Types" ([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

A special class, OperatorType, exists to represent operator types within the QPL generic query structure.

For example:

 a = and("thomas","jefferson")

In the above example, "a" will be an Operator object which has an OperatorType of "AND".

Naming Standards

Operator types must start with a letter, and are allowed to have the letters a-z, A-Z and "_" (underscore).

Type names, when used in Groovy are specified as ALL CAPS with underscores:

 def BOOST_PLUS = OperatorType.create("BOOST_PLUS");

This is also the representation of the type as stored in the OperatorType class.

Type names when printed out for the user are printed in camelCase:

 boostPlus("abc", "def")

The OperatorType methods will automatically normalize types as needed.

Creating New Operator Types

Use the static create() method to create a new operator type:

 def MY_TYPE = OperatorType.create("myType");

Note that all operator types should have a Groovy variable defined, so it can be used by later code, as necessary.