This table lists the filters in CQL as well as parameters or keywords each filter uses. This table is not normative: consult the documentation for the filter for the normative definition.

This table does not include symbolic filters: ., _, :, &, <, >, >=, =, =?, ==, !=, +, *, %, /, -, ~, |, {}, #, +=, -=, /=, *=, %=.

Table of Filters

Nameparametersargumentsexample
AA==2
aa==2
absnumberabs #A - #a
ancestor(position position)ancestor(source target)
andfilter/filtercheck and Q==2
attackedbyset/set _ attackedby k
attacksset/setA attacks k
BB==2
bb==2
between(set set)between(R k)
blackblack
btmbtm
checkcheck
child(number)child(3)
childchild
colortypesetcolortype d4
comment(filter...)comment("x is" x)
connectedpawnsconnectedpawns
consecutivemovesrange quiet(position position)consecutivemoves(source target)
currentpositioncurrentposition
darksetdark B
depthdepth>4
descendant(position position)descendant(source target)
distance(position position)distance(source target)
doubledpawnsdoubledpawns>= 4
downrangesetdown P
echoin all(variable variable)echo(s t)s&t==.
elowhite blackelo>2700
eventstringevent "Baden"
falsefalse
fenstringfen "8/8/8/8/8/8/8/6K.k"
filesetfile K
findrange all <--filterfind check
find all check
fliprangefilterflip Ad4 attacks k
flipcolorrangefilterflipcolor A attacks k
fliphorizontalrangefilterfliphorizontal Ae1 attacks k
flipverticalrangefilterflipvertical Ae1 attacks k
function{filter}function square(x) {x * x}
gamenumbergamenumber==1000
hascommentstringhascomment "good"
ifthen elsefilterif check then K else Q
inset/setR in (A attacks k)
initialinitial
isolatedpawnsisolatedpawns>3
KK attacks n
kk attacks n
lca(position position)lca(source target)
leftrangesetleft P
lightsetlight B==2
linefirstmatch lastposition singlecolor nestban primary range secondaryfilterline-->move promote A-->mate
loopfilterloop {child(i) i+=1}
mainlinemainline
makesquare(number number)makesquare(File Rank)
matemate
max(number number)max(#R #Q)
message(filter...)message("x is " x)
min(number number)min(#R #Q)
movecapture castle comment count count enpassant enpassantsquare from legal null o-o o-o-o previous primary promote pseudolegal secondary tomove from K to _
movenumbermovenumber>100
NN==2
nn==2
northeastrangesetnortheast P
northwestrangesetnorthwest P
notfilternot mate
orfilter/filtercheck or stalemate
PP==2
pp==2
parentparent:check
passedpawnspassedpawns>= 6
persistentvariable=numberpersistent x=5
pieceall infilterpiece x in A x attacks k
piece assignmentvariable=setpiece x = K
pieceidsetpieceid x
pinfrom through topin from Q
playerwhite blackstringplayer "Kasparov"
plyply>100
positionnumberposition 0
powersetpower A<5
QQ==2
qq==2
RR==2
rr==2
ranksetrank K == rank k
ray direction (set...)ray (R a k)
resultstringresult "1-0"
reversecolorrangefilterreversecolor A attacks k
rightrangesetright P
rotate45rangefilterrotate45 A attacks right k
rotate90rangefilterrotate90 A attacks up k
shiftrangefiltershift A e1 attacks kg1
shifthorizontalrangefiltershifthorizontal Ae1 attacks kg1
shiftverticalrangefiltershiftvertical Ae1 attacks kg1
sidetomovesidetomove==white
sitestringsite "Berlin"
sortmin documentation stringnumber or setsort "Material" power A
sqrtnumbersqrt 10000
squarein allfiltersquare s in _ k attacks s
stalematestalemate
terminalterminal
truetrue
typesettype d4
uprangesetup P
variationvariation
virtualmainlinevirtualmainline
whitewhite
wtmwtm
xray(set...)xray(R a k)
yearyear>2000