Tips for Using the Mojo Search Engine
Here are a few tips to take advantage of Mojo's search engine.
- Mojo searches the title and description of the ticket including custom fields and ticket comments.
- Search performs an exact lookup unless a wildcard symbol such as * or ? is used.
Wild Card Searches
Examples:
- serv*s will match both servers and services.
- *123 will match xyz123.
- inv?te will match invite but not invente.
- for abc will match only exact word abc.
Proximity Searches
Mojo supports finding words are a within a specified proximity. To do a proximity search use the tilde, ~, symbol at the end of a Phrase.
Example:
- "mojo users"~10 searches for a "mojo" and "users" within 10 words of each other.
Boolean Operators
Boolean operators allow terms to be combined through logic operators. Mojo supports AND, +, OR, NOT and - as Boolean operators (Note: Boolean operators must be in ALL CAPS ).
OR operator
The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. The OR operator links two terms and finds a matching document if either of the terms exist in a document. This is equivalent to a union using sets. The symbol || can be used in place of the word OR.
Example: To search for documents that contain either "mojo apache" or just "mojo" use the query:
"mojo apache"_||_mojo
Alternatively, the query below will yield the same string.
"mojo apache" OR mojo
AND operator
The AND operator matches documents where both terms exist anywhere in the text of a single document. This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND.
Example: To search for documents that contain "mojo apache" and "Apache Lucene" use the query:
"mojo apache" AND "Apache Lucene"
Alternatively, the query below will yield the same string.
"mojo apache" OR "Apache Lucene"
+ operator
The + or required operator requires that the term after the + symbol exist somewhere in a the field of a single document.
Example: To search for documents that must contain "mojo" and may contain "lucene" use the query:
+mojo lucene
NOT operator
The NOT operator excludes documents that contain the term after NOT. This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT.
Example: To search for documents that contain "mojo apache" but not "Apache Lucene" use the query:
"mojo apache" NOT "Apache Lucene"
Note: The NOT operator cannot be used with just one term. For example, the following search will return NO results:
NOT "mojo apache"
- operator
The - or prohibit operator excludes documents that contain the term after the - symbol.
Example: To search for documents that contain "mojo apache" but not "Apache Lucene" use the query:
"mojo apache" -"Apache Lucene"
Grouping
Mojo supports using parentheses to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query.
Example: To search for either "mojo" or "apache" and "website" use the query:
(mojo OR apache) AND website
This eliminates any confusion and makes sure you that website must exist and either term mojo or apache may exist.
For even more advanced search: Search reference manual