Filter bars are a recurring element on many pages in the orcharhino Management UI.
orcharhino filter bars support advanced search features like search suggestions, searching specific parameters, logic operators, and bookmarking searches for future reference. While the available search parameters differ for filter bars on different pages, the basic mechanic is always the same.
In order to illustrate the usage of filter bars, we will use the bookmarks page (see also Bookmarks from The Administer Menu) as an example throughout this section. (The bookmarks page exists to list all bookmarks for every filter bar in orcharhino.)
Even a clean install of orcharhino will have some preconfigured bookmarks:
- The filter bar (1) on the bookmarks page.
- The full list of bookmarks (2) (not filtered) on the bookmarks page.
- The input field (3) is used to enter a search query. (See also Using Search Suggestions below).
- The clear button (4) will clear whatever has been entered in the input field (3).
- The search button (5) will filter the current page according to whatever has been entered in the input field (3).
- The bookmark drop down menu (6). (See Using and Creating Bookmarks below).
Using Search Suggestions¶
When selecting the input field of a filter bar, a page specific drop down list of possible search parameters and operators (search suggestions) will appear:
- The bookmarks page has two possible search parameters (1).
- The bookmarks page also has two possible operators (2) for the start of a search.
When selecting or entering one of the possible search suggestions, adding an additional space behind it, will force the drop down list of search suggestions to adjust to show possible continuations:
- Once we add a space behind “controller” possible continuations appear in the drop down list.
When you are satisfied with your entered search query, click the search button to apply your filter:
In this particular example, the filter “controller = hosts” will yield the following bookmarks page:
- The search query (1) in use, is still displayed in the filter bar.
- Note how only bookmarks with “hosts” in the controller columb (2) are displayed in the filtered list of bookmarks
- Note how there are only six entries (3) as compared to the seventeen entries in the unfiltered list in the previous section. (See Filter Bars above).
A search that does not use any search parameters or operators will simply display all entries that contain the search query as a substring of any parameter.
Using and Creating Bookmarks¶
The bookmark drop down menu of a filter bar will display any existing bookmarks for that filter bar, as well as a “Bookmark this search” option:
- Clicking the bookmark drop down button (1) will open the bookmark drop dowmn menu.
- Selecting one of the existing bookmarks (2) will immediately apply a filter using the search query contained in the bookmark.
- Selecting the “Bookmark this search” option (3) will open the add bookmark window. If you have currently applied a filter, the add bookmark window will have prefilled fields, else it will be blank. (See the following example).
Continuing our example from the previous section, lets presume we have applied a filter to the bookmarks page using the search query “controller = hosts”. If we now select “Bookmark this search” from the filter bar’s bookmark drop down menu the following window will open:
- The suggested Name (1) may not be very descriptive and should be changed accordingly.
- The Search query field (2) can be left as is.
- If the Public check mark (3) is set, the bookmark will be available to all orcharhino users. If it is not set, the bookmark will only be visible to the user creating it.
- Remember to click Submit (4) to save your changes.
- Once created bookmarks can be edited or deleted from the Bookmarks page in The Administer Menu.
Our new bookmark has now been added to the filter bar:
- All orcharhino users can now filter the bookmarks page using the search query “controller = hosts” simply by clicking on the new public bookmark named “controller” (1). (This is particularly useful for more complicated search queries).
Filter bar search queries use the following grammar:
- <expression> = <string_parameter> <string_operator> <string>
- <expression> = <numeric_parameter> <numeric_operator> <numeric_expression>
- <expression> = not <expression> | has <expression>
- <expression> = <expression> and <expression> | <expression> or <expression>
- strings containing spaces need to be enclosed in quotes (“<string>”).
- round brackets can be used to adjust logic operator scope.
The following is a list of possible search query operators:
|not||prefix logic operator||logical negation|
|has||prefix logic operator||logical existence|
|and||infix logic operator||logical conjunction|
|or||infix logic operator||logical disjunction|
|!=||string comparison||not equals/unequal|
|~||string comparison||contains (substring match)|
|!~||string comparison||not contains|
|<||numeric comparison||less than|
|>||numeric comparison||greater than|