What is the query syntax for SearchBlox?

Here is a sample of search options through SearchBlox. 

Wildcard Searches

SearchBlox supports single- and multiple-character wildcard searches. 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 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*

You can also use the wildcard searches in the middle of a term.

te*t

Fuzzy Searches

SearchBlox supports fuzzy searches. To perform 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".

Proximity Search

SearchBlox supports finding words that are within a specific distance. To do a proximity search, use the tilde (~) symbol at the end of a phrase. For example, to search for “searchblox” and “j2ee” within 10 words of each other in a document use the search

“searchblox j2ee”~10

Boolean Operators

Boolean operators allow terms to be combined through logic operators. Lucene supports AND, “+”, OR, NOT and “-” as Boolean operators (Note: Boolean operators must be ALL CAPS).

Grouping

SearchBlox supports using parentheses to group clauses to form sub-queries. This is useful for users who want to control the Boolean logic for a query. To search for either “searchblox” or “server”, and “jee”, use the query:

(searchblox OR server) AND j2ee

This eliminates any confusion and makes sure that the website exists and either term "searchblox" or "server" exists.

Escaping Special Characters

SearchBlox supports escaping special characters that are part of the query syntax. The current list of special characters includes + - & || ! ( ) { } [ ] ^ “ ~ * ? : \. To escape these characters, use the \ before the character. For example, to search for (1+1):2 use the query:

\(1\+1\)\:2

For more details on the basics of SearchBlox's syntax and language support, refer to our help link below: https://developer.searchblox.com/docs/searching-in-searchblox#query-syntax



To learn more about SearchBlox please visit our developer document site https://developer.searchblox.com/docs

Have more questions? Submit a request

Comments