Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

QPL Option is the object which will decided the behaviour of our QPL query, from the default operator to the Saga coupling and the synonym injection

FieldTypeRequiredDefaultDescriptionExamples

implicit_operator

str(error)or

Default operator to use when the relationship, between 2 operands is ambiguous

"or", "and"

fields

List[str] OR Dict[str, float]

OR List[QPLField] OR str

(tick)



Fields to be use when match term, phrases, spans, ...


In the string formats you can add the boots by adding ^ and the amount to boots, e.g. ^2 or ^0.5

As string:

"field"

As a List:

["field1", "field2^2", "field3^3"]

As a Dictionary:

{"field1": 1, "field2" : 2, "field3": 3.0}

as a List of QPLFields:

[{"name":"field1", "boost": 1}, {"name":"field2", "boost": 2}, {"name":"field3", "boost": 3}]

date_fields

List[str] OR Dict[str, float]

OR List[QPLField] OR str

(error)

Fields to be use when date ranges, if no range queries are 


In the string formats you can add the boots by adding ^ and the amount to boots, e.g. ^2 or ^0.5

As string:

"field"

As a List:

["field1", "field2^2", "field3^3"]

As a Dictionary:

{"field1": 1, "field2" : 2, "field3": 3.0}

as a List of QPLFields:

[{"name":"field1", "boost": 1}, {"name":"field2", "boost": 2}, {"name":"field3", "boost": 3}]

range_fields

List[str] OR Dict[str, float]

OR List[QPLField] OR str

(error)

Fields to be use when ranges


In the string formats you can add the boots by adding ^ and the amount to boots, e.g. ^2 or ^0.5

As string:

"field"

As a List:

["field1", "field2^2", "field3^3"]

As a Dictionary:

{"field1": 1, "field2" : 2, "field3": 3.0}

as a List of QPLFields:

[{"name":"field1", "boost": 1}, {"name":"field2", "boost": 2}, {"name":"field3", "boost": 3}]

date_format

str(error)

Date format used to convert date values in the query. 

Note

The format to use must be compatible with the engine specific query


timezone

str(error)

Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query to UTC.

Note

The timezone to use must be compatible with the engine specific query


slop_near

number(error)0Slop for the near operator

slop_before

number(error)0

slop_adj

number(error)0

slop_span_not

number(error)0

wildcard

bool(error)False

Use wildcard operators


grammar

File Path Or str(error)

File path to the grammar or the actual raw grammar in string, in case you need to parse text to QPL with custom operators. QPL parser uses a Lalr parser implemented with Lark library, for more information check https://lark-parser.readthedocs.io/en/latest/grammar.html#



Warning

We recommend that before starting to make a new grammar, consult with the development team

For more detail on how to build a grammar please check Grammar Composition from the Lark documentation

custom_operators

Dict[str, Operand](error){}

Dictionary with the name type of the custom operator as keys, and the class with their logic as values. All classes must inherit from Operator


synonyms_call

Func[](error)

Function returning requested synonyms for the specified string




Saga QPLOptions

Saga QPLOptions is a super set of QPLOptions, plus the options to couple with Saga

FieldTypeRequiredDefaultDescriptionExamples

...same as QPLOptions, plus: 

saga_keywords


(error)[]

saga_synonyms


(error)[]

saga_synonyms_boost


(error)0.8

saga_special_case


(error){}