Search tips

Boolean query syntax

Boolean queries allow the following special operators to be used:

* explicit operator AND:

php & cms

This query means you want to find a php CMS, this is normally the same with "php cms".

* operator OR:

blog | cms

This query means you want to find a blog or a cms script, both of them will be returned by the system.

* operator NOT:

cms -mysql cms !mysql

If you want to find a CMS except mysql driven, operator will be your best choice in your query.

* grouping:

( php cms )

This operator make words within it as a whole, so the search engine will seperate it with others in a long query.

Here's an example query which uses all these operators:

Example: Boolean query example

( cms -mysql ) | ( blog -mysql)

There always is implicit AND operator, so "php cms" query actually means "php & cms".

OR operator precedence is higher than AND, so "looking for cms | blog | gallery" means "looking for ( cms | blog | gallery )" and not "(looking for cms) | blgo | gallery".

Queries like "-cms", which implicitly include all documents from the collection, can not be evaluated. This is both for technical and performance reasons.