Table of Contents
Configuring default search behavior
This topic outlines how you can set the default mode of operation when a user performs a search.
Table of Contents
How Fotoware searches
Fotoware performs searches in the connected pools. The backend search engine receives a search string and parameters from Fotoware, performs the search, and returns the results to the user in Fotoware.
Fotoware provides some parameters to configure these searches on three levels – the first being preparing the search string by doing required modifications, the second telling the search engine how to perform the actual search and finally processing the search results.
Search string modification
From the Tools menu (cogwheel icon) go to Site Configuration > Searching.
These options allow an administrator to choose how literal search strings with no operators in between are combined:
- using AND
- using OR
- Unmodified (as an exact phrase with a space between each two literals)
Notes:
- Search string modification is only applied when searching using the Search field in the main Fotoware interface and in the Collection Queries API (not in the Fotoware Pro interface).
- When search string modification is enabled, it causes certain words, such as "and" and "or" to be removed from the search string.
- Search string modification does not apply to custom search strings in taxonomies.
Example
The search input apples bananas pears will be interpreted as follows
Option | Actual search expression |
---|---|
AND | "apples" AND "bananas" AND "pears" |
OR | "apples" OR "bananas" or "pears" |
Do not modify | "apples bananas pears" |
Note that search these rules are only applied to simple search requests, i.e. requests that fulfill all of these criteria:
- A flat sequence of unquoted words with no operators or predicates
- The entire search expression is simple. In other words, search string modification is not applied to "simple" parts of a search expression
Which search expressions are "simple"?
Input | Simple? |
---|---|
apples pears -bananas | No, because an operator is used |
apples bananas pears | Yes |
apples and bananas | No, because an operator is used |
apples "bananas" pears | No, because a quoted string is used |
apples 2014-01-01 ~~ 2015-01-01 | No, because a range is used |
(apples bananas) pears | No, and the expression in parentheses is not treated as "simple", either |
(apples bananas pears) OR cars | No, and the expression in parentheses is not treated as "simple", either |
25:apples 25:pears | No, because field predicates are used |
In all of the above examples that are not simple, AND is inserted where ever a logical operator was omitted, regardless of the search string modification setting. Only in the examples that are simple is the search string modification setting used.