The query syntax can be used in Squirro to search items.
Table of Contents
Introduction
Title and body fields are taken into account when searching.
By default the terms entered are or-combined with an additional clause that at least 1/3 of all terms must appear in a document to match. That means for a query with up to five terms, at least one must match and for a query between 6 and 8 terms, at least two terms must match and so on.
Boolean Operators
Use AND, OR, NOT, + (plus sign) or - (minus sign) to explicitly combine terms. Be aware that the operators need to be in all capital letters.
The following restrictions apply:
- The + or required operator requires that the term after the + symbol exist somewhere.
- The - or prohibit operator excludes documents that contain the term after the - symbol.
Example Queries
Query | Description |
---|---|
squirro AND memonic | Search documents that contain squirro and memonic. |
squirro OR memonic | Search documents that contain either squirro or memonic. |
+memonic -squirro | Search documents that contain memonic but do not contain squirro. |
squirro NOT memonic | Search documents that contain squirro but do not contain memonic. |
Grouping
Use brackets for grouping.
Example Queries
Query | Description |
---|---|
(java AND solr) OR (python AND elasticsearch) | Search documents that contain both java and solar, or documents that contain both python and elasticsearch. |
nektoon AND (squirro OR memonic) | Search documents that contain nektoon and either squirro or memonic. |
Phrase Search
Use double quotes at the beginning and ending of a phrase to perform a phrase search. Phrases must match exactly (i.e. no stemming is applied within a phrase). You can also add a slop to the phrase with a tilde ~ at the end of the phrase to do a proximity search.
Example Queries
Query | Description |
---|---|
"oracle financial services" | Search documents where oracle, financial and services match in exact this order and within three terms. |
"oracle financial leasing"~3 | Search documents where oracle, financial and leasing must match in exact this order but allow for up to 3 additional terms between them. |
Wildcard Search
Use * and ? to perform a wildcard search. Multiple character wildcard searches looks for 0 or more characters and the single character wildcard search looks for terms that match that with the single character replaced. Leading wildcards are allowed.
Example Queries
Query | Description |
---|---|
squirr* | Search documents that contain e.g. for squirro and squirrel. |
*emonic | Search documents that contain e.g. for memonic and mnemonic. |
te?t | Search documents that contain e.g. for test and text. |
Field Search
Only search in specific fields
Query | Description |
---|---|
$title:France | Search documents that have the term France in the title |
$body:France | Search document that have the term France in the document body |
$item_id:PgnAQM1FTSCP1uNOesoE7Q | Search for a specific document by id |
$item_created_at >= "2015-02-01T00:00:00" | Search documents created after Feb. 2, 2015 |
$item_created_at <= "2015-02-01T00:00:00" | Search documents created before Feb. 2, 2015 |
Facet Search
Use any document facet to restrict the search.
Query | Description |
---|---|
Country:France | Search documents that have a facet named Country with a value France |
Country:"United Kingdom" | Search documents that have a facet named Country with a value United Kingdom |
"Mixed Sentiment":Yes | Search document that have a facet named Mixed Sentiment with a value Yes |
Sorting
Use sort:date|relevance[:asc|desc]
to sort the result. Default sorting is sort:date:desc
. The order suffix is optional, default order is descending.