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
Name | parameters | arguments | example |
---|---|---|---|
A | A==2 | ||
a | a==2 | ||
abs | number | abs #A - #a | |
ancestor | (position position) | ancestor(source target) | |
and | filter/filter | check and Q==2 | |
ascii | string or number | X=ascii "A" Y=ascii 65 | |
assert | filter | assert X==0 | |
attackedby | set/set | _ attackedby k | |
attacks | set/set | A attacks k | |
B | B==2 | ||
b | b==2 | ||
between | (set set) | between(R k) | |
black | black | ||
btm | btm | ||
check | check | ||
child | (number) | child(3) | |
child | child | ||
colortype | set | colortype d4 | |
comment | (filter...) | comment("x is" x) | |
connectedpawns | connectedpawns | ||
consecutivemoves | range quiet | (position position) | consecutivemoves(source target) |
currentposition | currentposition | ||
currenttransform | currenttransform | ||
dark | set | dark B | |
date | implicit search parameter | date~~"199[5-9]" | |
depth | depth>4 | ||
descendant | (position position) | descendant(source target) | |
dictionary | dictionary X["a"]="bc" | ||
distance | (position position) | distance(source target) | |
doubledpawns | doubledpawns>= 4 | ||
down | range | set | down P |
echo | in all echo quiet | (variable variable) | echo(s t)s&t==. |
eco | implicit search parameter | X=eco | |
elo | white black | elo>2700 | |
event | implicit search parameter | x=event | |
eventdate | implicit search parameter | eventdate~~"199[4-7]" | |
false | false | ||
fen | string | X=fen | |
file | set | file K | |
find | rangeall quiet <-- | filter | find check find all check |
flip | count | filter | flip Ad4 attacks k |
flipcolor | count | filter | flipcolor A attacks k |
fliphorizontal | count | filter | fliphorizontal Ae1 attacks k |
flipvertical | count | filter | flipvertical Ae1 attacks k |
function | {filter} | function square(x) {x * x} | |
gamenumber | gamenumber==1000 | ||
hascomment | string | hascomment "good" (deprecated) | |
Heijden database VI interface | see documentation | hhdb composer "Reti" hhdb sort award | |
if | testfilter consequent | if check "In check" | |
if | testfilter consequent else elsefilter | if check "In check" else "safe" | |
in | set/set | R in (A attacks k) | |
in | string/string | "Q" in fen | |
indexof | string string | indexof("King" "a King")==2 | |
initial | initial | ||
initialposition | initialposition:check | ||
int | string | int "64" == 64 | |
isbound | isbound Foo | ||
isolatedpawns | isolatedpawns>3 | ||
isunbound | isunbound Foo | ||
K | K attacks n | ||
k | k attacks n | ||
lca | (position position) | lca(source target) | |
left | range | set | left P |
light | set | light B==2 | |
line | firstmatch lastposition singlecolor nestban primary range secondary quiet | filter | line-->move promote A-->mate |
loop | filter | loop {child(i) i+=1} | |
lowercase | string | lowercase "Tal"=="tal" | |
mainline | mainline | ||
makesquare | (number number) | makesquare(File Rank) | |
mate | mate | ||
max | (number number) | max(#R #Q) | |
message | message quiet | (filter...) | message("x is " x) |
min | (number number) | min(#R #Q) | |
move | capture castle comment count enpassant enpassantsquare from legal null o-o o-o-o previous primary promote pseudolegal secondary to | move from K to _ | |
movenumber | movenumber>100 | ||
N | N==2 | ||
n | n==2 | ||
northeast | range | set | northeast P |
northwest | range | set | northwest P |
not | filter | not mate | |
notransform | filter | notransform a4 | |
or | filter/filter | check or stalemate | |
originalcomment | string | originalcomment "good" | |
P | P==2 | ||
p | p==2 | ||
parent | parent:check | ||
passedpawns | passedpawns>= 6 | ||
persistent | quiet | variable=number | persistent x=5 |
piece | in all | filter | piece x in A x attacks k |
piece assignment | variable=set | piece x = K | |
pieceid | set | pieceid x | |
pin | from through to | pin from Q | |
player player white player black | implicit search parameter | player "Kasparov" player white ~~ "Kas.*ov" x=player black | |
ply | ply>100 | ||
position | number | position 0 | |
positionid | positionid == 0 | ||
power | set | power A<5 | |
Q | Q==2 | ||
q | q==2 | ||
R | R==2 | ||
r | r==2 | ||
rank | set | rank K == rank k | |
ray | direction | (set...) | ray (R a k) |
readfile | string | X=readfile "a.cqo" | |
removecomment | removecomment | ||
result | string | result "1-0" | |
reversecolor | count | filter | reversecolor A attacks k |
right | range | set | right P |
rotate45 | count | filter | rotate45 A attacks right k |
rotate90 | count | filter | rotate90 A attacks up k |
settag | (quoted string string or int) | settag("MyTag" "blunder") | |
shift | count | filter | shift A e1 attacks kg1 |
shifthorizontal | count | filter | shifthorizontal Ae1 attacks kg1 |
shiftvertical | count | filter | shiftvertical Ae1 attacks kg1 |
sidetomove | sidetomove==white | ||
site | implicit search parameter | site "Berlin" x=site | |
sort | min documentation | number or set | sort "Material" power A |
sqrt | number | sqrt 10000 | |
square | in all | filter | square s in _ k attacks s |
stalemate | stalemate | ||
str | (filter...) | X=str("K on: " K) | |
tag | quoted string | tag "UTCDate" | |
terminal | terminal | ||
true | true | ||
type | set | type d4 | |
unbind | variable dictionary dictionary[string] | unbind X unbind Dict["ch"] | |
up | range | set | up P |
lowercase | string | lowercase "Tal"=="tal" | |
variation | variation | ||
virtualmainline | virtualmainline | ||
while: standard form | (test)body | while(x<3){z+=1 x+=1} | |
while: ~~ form | (target~~pattern)body | while(player~~".")... | |
white | white | ||
writefile | (filename contents) | writefile("a.cqo" fen) | |
wtm | wtm | ||
xray | (set...) | xray(R a k) | |
year | year>2000 |