Here you can find a all the available operators, their representation in query string, as well as any possible variation. And examples of their equivalent with Manual Query

NameOperatorVariationExamplesManual Query
Term{TOKEN}
one
qpl.term(term='one')


Terms{TOKEN} {TOKEN} {TOKEN} {TOKEN}
all these are tokens
qpl.terms(terms=['all', 'these', 'are', 'tokens'])
Phrase"{TOKEN} {TOKEN}"'{TOKEN} {TOKEN}'
"This is a phrase" but all these are tokens
'This is a phrase' but all these are tokens

Just the phrase

qpl.phrase(phrase='This is a phrase')


Full example

qpl.or_(operands=[qpl.phrase(phrase='This is a phrase'), qpl.terms(terms=['but', 'all', 'these', 'are', 'tokens'])])
Or{OPERAND} OR {OPERAND}

Explicit

one OR two

If OR is the implicit operator

one two
qpl.or_(operands=[qpl.term(term='one'), qpl.term(term='two')])
And{OPERAND} AND {OPERAND}

Explicit

one AND two

If AND is the implicit operator

one two
qpl.and_(operands=[qpl.term(term='one'), qpl.term(term='two')])
NotNOT {OPERAND}- {OPERAND}
this but NOT that
this but -that

Just the not

qpl.not_(operands=qpl.term(term='that'))

Full example

qpl.or_(operands=[qpl.term(term='this'), qpl.term(term='but'), qpl.not_(operands=qpl.term(term='that'))])
Grouping( {OPERAND} {OPERAND} ... )
(cats AND dogs)



(cats AND dogs NOT ("black cats" OR "white dogs"))
No manual equivalent for grouping
BOOST{OPERAND}^{NUMBER}
dogs^3.5 have more boost than cats^2

Works with phrases as well

"this phase"^3.5

Term example

qpl.term(term='dogs', boost=3.5)

Phrase example

qpl.phrase(phrase='this phase', boost=3.5)

Applies for almost all operators

Wildcard* or ?Just *

For zero o more characters

All *.py files
I want my ki*y

for any character

I want my p?t
the year was 19??

For zero or more characters

qpl.wildcard(wildcard='*.py')

for any character

qpl.wildcard(wildcard='p?t')


Just *

qpl.wildcard(wildcard='*')
Date Range{DATE}:{DATE}{DATE}-{DATE}

With colon (:)

We encourage the use of  colon (:) for date ranges, is easier to read for us

1970/08/03:2022/09/29
1970-08-03:2022-09-29
1970.08.03:2022.09.29
70/AUG/03:22/SEP/29
70-AUG-03:22-SEP-29
1970.08.03:2022.09.29
70.AUG.03:22.SEP.29
08/03/1970:09/29/2022
08-03-1970:09-29-2022
08.03.1970:09.29.2022
AUG/03/70:SEP/29/22
AUG-03-70:SEP-29-22
AUG.03.70:SEP.29.22
03/08/1970:29/09/2022
03-08-1970:29-09-2022
03.08.1970:29.09.2022
03/AUG/70:29/SEP/22
03-AUG-70:29-SEP-22
03.AUG.70:29.SEP.22
With dash (-)


We recommend not to use - for date ranges. The parser does understand these, but we hardly can

1970/08/03-2022/09/29
1970-08-03-2022-09-29
1970.08.03-2022.09.29
70/AUG/03-22/SEP/29
70-AUG-03-22-SEP-29
1970.08.03-2022.09.29
70.AUG.03-22.SEP.29
08/03/1970-09/29/2022
08-03-1970-09-29-2022
08.03.1970-09.29.2022
AUG/03/70-SEP/29/22
AUG-03-70:SEP-29-22
AUG.03.70-SEP.29.22
03/08/1970-29/09/2022
03-08-1970-29-09-2022
03.08.1970-29.09.2022
03/AUG/70-29/SEP/22
03-AUG-70-29-SEP-22
03.AUG.70-29.SEP.22

Applies for all formats

qpl.date_range(start='1970/08/03', end='2022/09/29')
Range{NUMBER}:{NUMBER}{NUMBER}-{NUMBER}
With colon (:)


We encourage the use of  colon (:) for ranges, is easier to read for us

10:20 
-10:20  
-10:-20  
-10.5:-20.32  
With dash (-)


We recommend not to use - for ranges. The parser does understand these, but we hardly can

10-20 
-10-20   
-10--20  
-10.5--20.32

Applies for all formats

qpl.range(start=10, end=-20)
Field{FIELD_NAME}:{OPERAND}
title:Cheese
title:Cheese^2
title:"Cheese & Beacon"
title:"Cheese & Beacon"^2

Term example

qpl.term(term='Cheese', fields=['title'], boost=2)

Phrase example

qpl.phrase(phrase='Cheese & Beacon', fields=['title'], boost=2)

Applies for almost all operators

Near{OPERAND} NEAR {OPERAND}
"this phrase" NEAR (this tokens)
qpl.near(operands=[qpl.phrase(phrase='this phrase'), qpl.or_(operands=[qpl.term(term='this'), qpl.term(term='tokens')])],  slop=10)
Before{OPERAND} BEFORE {OPERAND}
"this phrase" BEFORE (this tokens)




qpl.before(operands=[qpl.phrase(phrase='this phrase'), qpl.or_(operands=[qpl.term(term='this'), qpl.term(term='tokens')])],  slop=2)
Adjacent{OPERAND} ADJ {OPERAND}
"this phrase" ADJ (this tokens)




qpl.adj(operands=[qpl.phrase(phrase='this phrase'), qpl.or_(operands=[qpl.term(term='this'), qpl.term(term='tokens')])], slop=0)
Span Not{OPERAND} SPAN_NOT {OPERAND}
"this phrase" SPAN_NOT (this tokens)




qpl.span_not(operands=[qpl.phrase(phrase='this phrase'), qpl.or_(operands=[qpl.term(term='this'), qpl.term(term='tokens')])], slop=0)
  • No labels