Keyword Search Expressions Syntax

 

Search Query Types

Search queries can be done in a variety of different ways. Drupal's search allows the user create very powerful search by merely adding a few key words or symbols.

AND Searches

To get results which match multiple words, simply type the words that you want to find. This is the default behavior of Drupal's search.

OR Searches

To search for data which may contain one of a few terms, but not necessarily all of the terms, you need an OR search. Use the keyword OR in between each search term: "dogs OR cats" or "dogs OR cats OR birds".

Notice that the keyword "OR" must be capitalized. If you use the lower case "or" instead, search module thinks that this is another word to search for, and since it is probably smaller than the search word length (the default is 3 characters), search module simply ignores it and does a "AND" search on the two words.

Exclusionary Searches

You can search for things that don't exist. For example, if you wanted to search pet stores which do not have chickens, you need an exclusionary search. Drupal allows you to do this using the minus "-" sign. For example "pet stores -chickens" finds all nodes with "pet" and "stores that do not also contain the words "chickens".