docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.1Web Developer ManualSearch
Copyright  2013, Roxen Internet Software
Suggestions, comments & compliments

Query Syntax

Query Syntax

The query is basically a list of words that you are searching for. Separate the words with spaces. There are two types of search modes, "implicit or" and "implicit and". In the "implicit or" mode, it is sufficient that some of the words are present for a document to be considered a hit. However, the more of the words that are present in the page, the higher its score, and of course it is not a hit if none of the words are present. In the "implicit and" mode, all of the words in the query must be present in the document.

If the words in the document appear in the same order as in your query, and close to each other in the text, then the score of the document gets higher than if the words appear randomly scattered in the document.

The search engine doesn't distinguish lowercase from uppercase so you don't have to think about capitalization.

Phrase Search

If you write text inside quotation marks, the search engine is instructed to look for phrases and not just single words. So if you wish to search for the phrase "content management", you write:

"content management"

Then, only documents with the two words "content" and "management" present, and in sequence, will be returned. Note that since the query disregards from interpunctuation and case, you may get a hit on a sentence border, e.g. "I am content. Management is needed.".

Word Exclusion

Sometimes you want to search for documents that contain some specific words, but only if they don't contain another word. For example you might be looking for documents about Java, not the programming language but rather the island. You would then write:

java -programming -computer

By preceding a word with a minus sign, you tell the search engine only to look for documents that match the rest of the query, and that don't contain the word in question. The same goes for phrases, so if you wish to see pages about the Russian author Anton Chechov, but not those that deal with his most famous play, you should enter:

anton chechov -"the cherry orchard"

Prioritizing Words

Some words may be more important than others in your query. If the search is done in the "implicit or" mode, then it is not necessary for all words to be present. You can override this behaviour for specific words in your query. If you are looking for documents about Perl programming, but not documents about programming in general, you could enter:

+perl programming

By preceding a word with a plus sign, you tell the search engine that you are only looking for documents that contain that word. Similarly, you can precede a phrase by a plus sign, marking that is as necessary in your search.

Searching Fields

The words in a document belong to different fields, depending on where in a document they occur. You can specify a field to search in in the search query. You do this by entering the name of the field, followed by a colon. Everything up to the next such field designator is then supposed to be found in that field. If you use the field name "any", then all fields are searched. This is also the default if you don't specify any fields. So let's assume that you are looking for documents about programming and that they must have the words "easy" and "introduction" in their title:

programming title: +easy +introduction

Fields such as file category can also be used. The category reference is a bit complicated to specify by hand however, so it will help to build a form such as a drop-down menu for this:


Date search

Search results can be limited according to specified dates by using the date keyword with an operator and a date. Valid operators are =, <>, !=, <=, >=, < and >. Date expressions can be combined with logical expressions (see below). Valid dates are (YYYY is year, MM is month and DD is day):



date < 2010
date = 2000-02-29
date >= 2000-02 AND date <= 2000-05
date = 2000 OR date = 2001
date != 2004
date = today

Logical Expressions

Sometimes it is not sufficient to control just what words should be in the document and what words shouldn't. You can then combine several queries in one by using the logical operators. Say that you want to find documents that contain both the words "banana" "skid", or documents that contains the word "orange" in the title, then you would enter:

banana skid OR title: orange

A document containing both one of the words "banana" "skid", and the word "orange", will be given a higher score than a document that matches only one of the subqueries.

You can also use the operator AND to tell the search engine just to look for documents that match both subqueries. Both AND and OR can be used for more than two subqueries. If both operators are used, AND takes precedence over OR. You can use parentheses to group terms and change the precedence:

(sweden OR norway) AND "folk dance"


The operators can be written in lowercase aswell. I have used uppercase just to make them more visible in the examples. If you want to search for the word "and", just write it inside quotes and it will not be recognized as an operator.