I am reading reference for Keyword Query Language in Sharepoint Search and trying to figure out how AND and OR operators work. I am specifically interested in KQL, not FQL. I am trying to figure out answers to the following questions:
worda wordb
? I understand that documents containing both worda
and wordb
. If so then AND keyword seems to be the default. Then why does it exist at all?worda OR wordb AND wordc
- in this query is wordb
mandatory or optional?worda OR wordb wordc
- is wordc
mandatory here?worda wordb
AND operator is used by default. If you need OR operator in free-text query you must use it explicitly.propertyA:"worda" propertyB:"wordb"
OR operator is default and AND operator must be used explicitly.worda OR wordb wordc
is the same as worda OR wordb AND wordc
and it's the same as worda OR (wordb AND wordc)
. If you want different behavior you need use (worda OR wordb) AND wordc
.