TABLE OF CONTENTS

The Search Query Builder is an interactive tool that allows users to dynamically construct a search query using drag and drop components. The Builder is particularly useful for users new to advanced search syntax, as it allows users to configure more complex search queries with ease.

As the query is constructed in the builder, the respective syntax is updated in realtime in the search bar, acting as a learning tool for translating modifiers, boolean operators, grouping, and field searches in the Lucene query language.

Users can also input and edit syntax in the Search bar while the Query builder is enabled. This provides users a with a visual representation of their query as it is built. 

To show the Query builder, enable the Query Builder toggle next to the Search bar.

Adding a term

With the Builder enabled, click on the ‘Add term’ button or click and drag from the ‘Add term’ button to add a new component to the builder.

Each rule component has the following options: 

  • Field dropdown: Always pre-populated with the ‘Text’ field. The field dropdown allows users to select a different metadata field to perform a field search 

  • Operator dropdown: Allows user to specify whether the term should, must, or must not exist 

  • Text input field: Text entry field to enter a single term or phrase

  • Modifier dropdown: Allows users to configure Fuzzy or Boost on a single term, or configure Proximity or Boost on a phrase 

  • Delete button (shows on hover)

Adding additional rules or logic groups to the builder will give the user an option to select the AND or OR boolean operators between each component. OR is added by default.

New and/or existing rules can be reordered and added to or dragged out of logic groups by clicking and dragging on the textured ‘grips’ on each component. 

Adding a logic group

With the Builder enabled, click on the ‘Add logic group’ button or click and drag from the ‘Add logic group’ button to add a new group component to the builder.

A new logic group component is empty by default. New and/or existing terms and logic groups can be dragged into, reordered, or dragged out of logic groups by clicking and dragging on the textured ‘grips’ on each component. 

To create more complex queries, groups can also be nested within one another. For visibility, nested groups are highlighed in contrasting colours.

Note: Deleting a group will also delete everything inside of it

Field Searches using the Builder 

Depending on the field chosen on the term component, the component will update to display the relative input fields:

  • Text fields: Standard operators (should have, must have, must not have) and text input fields

  • Tag, choice, and user fields: Standard operators (should have, must have, must not have) and choice, tag, or user pickers

  • Date fields: Date operators (on, after, before, between) and date picker(s)

  • Number fields: Number operators (equal to, not equal to, greater than, greater than or equal to, less than, less than or equal to) and a number entry field.


Modifier dropdown

A ‘More’ dropdown selector will show on the right side of a term component when any text field is selected. Depending on whether the term entered in the component is a single term or phrase, the following modifiers can be applied:

  • Fuzzy: for single terms only. Users can select a fuzziness of 1 or 2.

  • Proximity: for phrases only. Users can enter any positive integer.

  • Boost: for single terms and phrases. Users can enter any positive integer.

Note: Wildcard is not an available option in the modifier dropdown. However, users can easily add either wildcard symbol (? for a single character wildcard or * for a multiple character wildcard) to single terms in the query builder.