-
Notifications
You must be signed in to change notification settings - Fork 2
Searching
SAGE offers different ways to search using different search algorithms chosen by the manager of a Discovery View.
When something is case-sensitive, then the upper case or lower case equivalent characters are treated as different. When something is case-insensitive, then the upper case and lower case equivalent characters are treated as the same.
The search behavior follows the case-insensitive practice.
That is to say the search words APPLE
, Apple
, apple
, and aPPLe
are all treated the as the same exact word when searching.
Query parsers provide more advanced control over how searching is performed when attempting to match the requested keywords. The particular query parser used is determined by the manager who created the Discovery View.
There are three different parsers.
- Standard Query Parser (Lucene)
- DisMax Query Parser (Dismax)
- Extended DisMax Query Parser (Edismax)
The Standard Query Parser (Lucene) is a robust and intuitive parser with a downside of being picky about syntax.
The DisMax Query Parser (Dismax) is a parser designed around searching and matching phrases without requiring complex syntax and has no wild card support.
The Extended DisMax Query Parser (Edismax) is a parser a variant of the Dismax parser that brings in the syntax of the Lucene parser allowing for wild card support.
Some of the common syntax for the Lucene and Edismax parsers:
- Boolean operators such as
AND
(+
,&&
),OR
(||
),NOT
(-
) for combining words, such asMy OR apple
andMy AND apple
. - Positive and negative queries, such as
+apple
or-apple
where the+
means with and-
means without. - The following special characters must be escaped (using a backslash
\
) to match:+
-
&&
||
!
(
)
{
}
[
]
^
"
~
*
?
:
/
(Escaping the!
would look like\!
). - Terms can be grouped using the parenthesis, such as
Apple OR (my AND red)
to match either apple or both the words "my" and "red".
The operand determines how to interpet spaces between words.
There are two operands available:
OR
AND
The OR
operand works by treated spaces as an or condition.
For example, searching for "My Apple" could find particular titles such as:
- My red apple
- My apple
- Blue apple
- My orange
This works because the search is for the word My
or the word Apple
.
The most command behavior in search engines is to use the OR
operand.
The AND
operand works by treated spaces as an and condition.
For example, searching for "My Apple" could find particular titles such as:
- My apple
This works because the search is for the word My
and the word Apple
.
The technical documentation for the Solr Core Parsers: