The search engine in BELTS is built upon Jakarta Lucene. This document will provide you with an understanding of the query language and help you target your searches effectively.
A query revolves around words. For searching purposes BELTS considers a word as an unbroken sequence of letters, numbers, underscores (_), hyphens (-) and single quotes ('). For example:
“O'Neill” is one word
“Marlan/O'Neill” is two words; “Marlan” and “O'Neill”
“education.au” is two words; “education” and “au”
“test-user_1” is one word; “test-user_1”
Words are the basic building block for query terms. There are two types of terms: single terms and phrases.
A single term is a single word such as “Learning” or “Federation”.
A Phrase is a group of words surrounded by double quotes such as “The Learning Federation”.
Multiple terms can be combined together with boolean operators such as “OR” and “AND” (see below for more details) to form a more complex query.
Query terms support modifiers to provide a wide range of searching options.
Single and multiple character wildcard searches are supported.
To perform a single character wildcard search use the “?” symbol.
To perform a multiple character wildcard search use the “*” symbol.
The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for “text” or “test” you can use the search:
te?t |
Multiple character wildcard searches looks for 0 or more characters. For example, to search for test, tests or tester, you can use the search:
test* |
te*t |
Note | |
---|---|
You cannot use a * or ? symbol as the first character of a search. |
Fuzzy searches based on the Levenshtein Distance, or Edit Distance algorithm are also supported. To use a fuzzy search use the tilde, “~”, symbol at the end of a Single word Term. For example to search for a term similar in spelling to “roam” use the fuzzy search:
roam~ |
Note | |
---|---|
Terms with a fuzzy search modifier will automatically get a boost factor (see below) of 0.2 |
Finding words within a specific distance away is also supported. To do a proximity search use the tilde, “~”, symbol at the end of a phrase. For example to search for “calculate” and “speed” within 10 words of each other in a document use the search:
"calculate speed"~10 |
You can boost the relevance level of matching documents based on the terms found. To boost a term use the caret, “^”, symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be. For example, if you are searching for “calculate speed” and you want the term “calculate” to be more relevant, you would type:
calculate^4 speed |
You can also boost Phrase Terms as in the example:
"learning object"^4 "learning federation" |
By default, the boost factor is 1 and although the boost factor must be positive, it can be less than 1 (e.g. 0.2)
Boolean operators allow terms to be combined. “AND”, “+”, “OR”, “NOT” and “-” are supported.
The OR operator is the default 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.
To search for documents that contain either “learning object” or just “federation” use the query:
"learning object" federation |
"learning object" OR federation |
The AND operator matches documents where both terms exist anywhere in the text of a single document.
To search for documents that contain “learning object” and “learning federation” use the query:
"learning object" AND "learning federation" |
The “+” or required operator requires that the term after the “+” symbol exist somewhere in the document.
To search for documents that must contain “learning” and may contain “federation” use the query:
+learning federation |
The NOT operator excludes documents that contain the term after NOT.
To search for documents that contain “learning federation” but not “learning object” use the query:
"learning federation" NOT "learning object" |
Note | |
---|---|
The NOT operator cannot be used with just one term as it will return no results |
The “-” or prohibit operator excludes documents that contain the term after the “-” symbol.
To search for documents that contain “learning federation” but not “learning object” use the query:
"learning federation" -"learning object" |
Parentheses may be used to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query.
To search for either “federation” or “object” and “learning” use the query:
(federation object) AND learning |
Special characters that are part of the query will need to be escaped. The current list of special characters are
+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ |
\(1\+1\)\:2 |