FBO Search Tips
These illustrate the use of search terms and phrases, Boolean operators, grouping, wildcards, and proximity searches.
- space AND flight
Finds notices containing with the words "space" and "flight".
- "space flight"~10
Finds notices containing the words "space" and "flight" within 10 words of each other (proximity search).
- database AND mysql NOT oracle
Finds notices containing the words "database" and "mysql", but not "oracle".
- micro* AND circuitry
Finds notices containing both words that begin with "micro" and the word "ciruitry".
- "office supplies" AND ( printer OR toner)
Finds notices containing the phrase "office supplies" in addition to either of "printer" or "toner".
- +space flight
Finds notices with the word "space" which may or may not contain the word "flight".
Search Terms and Phrases
When you are entering a search item (for instance data in a keyword search field), you will want to think of your search as being comprised of two components: terms and operators.
There are two types of terms: Single Terms and Phrases:
Single Term is a single word such as test or hello.
- A Phrase is a group of words surrounded by double quotes such as "bat tub". Multiple terms can be combined together with Boolean operators to form a more complex query.
Boolean Operators and Grouping
Boolean operators allow terms to be combined through logic operators. FBO supports AND, OR, NOT, "+", and "-" as Boolean operators.
Note: Boolean operators AND, OR, NOT must be in ALL CAPS otherwise they are interpreted as search terms.
- 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 of sets. The symbol "||" can be used in place of the word OR.
- To search for items that contain either of jakarta, apache or just jakarta use the query: jakarta apache.
- The AND operator finds results where both terms exist anywhere in the text of an item.This is equivalent to an intersection using sets. The symbol can be used in place of the word AND. To search for documents that contain jakartaapache and Apache Lucene use the query: "jakarta apache" AND "Apache Lucene"
- The "+" or required operator requires that the term after the "+" symbol exist somewhere in a field of an item. To search for documents that must contain jakarta and may contain lucene use the query: +jakarta lucene
- The NOT operator excludes items 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. To search for items that contain jakarta but not Apache Lucene use the query: jakarta NOT "Apache Lucene".
- Note: The NOT operator cannot be used with just one term. For example, the following search will return no results: NOT "jakarta apache"
- The "-" or prohibit operator excludes items that contain the term after the "-" symbol. To search for items that contain jakarta apache but not Apache Lucene use the query: "jakarta apache" -"Apache Lucene"
- Grouping - The system 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.To search for either jakarta or apache and website use the query: (jakarta OR apache) AND website. This makes sure website exists and either term jakarta or apache may exists in the result.
Term Modifier Operators (Wildcard, Fuzzy, Proximity)
FBO supports modifying query terms to provide a wide range of searching options:
- Wildcard Searches - FBO supports single and multiple character wildcard searches within single terms (not within phrase queries). 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 zero or more characters. For example, to search for test, tests or tester, you can use the search: test*. You can also use the wildcard searches in the middle of a term: te*t. Note: You cannot use a * or ? symbol as the first character of a search.
- Fuzzy Searches - FBO supports fuzzy searches based on the Levenshtein Distance, or Edit Distance algorithm. To do 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~. This search will find terms like foam and roams. An additional parameter can specify the required similarity. The value is between 0 and 1, with a value closer to 1 only terms with a higher similarity will be matched. Similarity is defined as by the minimum number of operations needed to transform one string into the other, where an operation is an insertion, deletion, or substitution of a single character. For example: roam~0.8. The default that is used if the parameter is not given is 0.5.
- Proximity Searches - FBO supports finding words that are within a specific distance away from each other in a data set. To do a proximity search use the tilde, "~", symbol at the end of a Phrase. For example to search for a apache and jakarta within 10 words of each other in a document use the search: "jakarta apache"~10
FBO Uses the Lucene search engine and this documentation is adapted from the official Lucene query syntax document, with portions Copyright Â© 2006 The Apache Software Foundation.