  You're browsing the documentation for an old version of SupportPal. Consider upgrading to the [latest version](https://docs.supportpal.com/current/Search). 

# Search

The search bar in the header of the operator panel allows staff to search SupportPal for users and tickets matching the term.

## How search works

The search results are broken up into two components: users and tickets. Below we detail how searching works for each of these:

### Ticket Search

Ticket search is slightly more complex as it not only looks at the ticket table but also at every message belonging to the ticket:

- Ticket number
- Ticket subject
- Ticket message content

SupportPal makes use of FULLTEXT search, but this introduces a few caveats that you should be aware of when writing search terms:

- A phrase that is enclosed within double quote (`"`) characters matches only rows that contain the phrase *literally, as it was typed*.
- A phrase that is enclosed within single quote (`'`) characters, will have those characters stripped; `'aaa'bbb'` would be parsed as `aaa'bbb`
- The search term is split into words, and a search is performed for each individual word. Words are made up of letters, digits, and underscores. Word boundaries are determined by the presence of non-word characters; for example, (space), , (comma), . (period), and so on...
- Words less than 3 characters are ignored
- Stop words, considered to have zero semantic value, are ignored; see [Full-Text Stopwords](https://dev.mysql.com/doc/refman/5.6/en/fulltext-stopwords.html) to view the default stopword lists and how to change them

For example, if you wanted to search for any ticket with a message containing `joe@supportpal.com` the search term must be encoded in double quotes (`"`) otherwise the words `joe`, `supportpal`, and `com` would be searched for individually which would match significantly more records.

For more information, please read: <https://dev.mysql.com/doc/refman/5.6/en/fulltext-natural-language.html>

### User Search

The search term will be wrapped in a wildcard and checked against the following user table columns:

- Firstname
- Lastname
- Firstname lastname (concatenated together by a single space)
- Email

Consider the following example,` Joe Blogs <joe@supportpal.com>`. If we search for "`pal`", then the database will look for any string containing "`pal`" and in this case the email, `joe@supportpal.com`, would match.

### Organisation Search

The search term will be wrapped in a wildcard and checked against the name of the organisation.

## Refining search results

It is possible to further filter the search results by clicking **Filter Results** in the yellow bar above the table. The respective grids contain a number of additional conditions that can be used to further refine the search results. To add additional conditions, click the **Add Condition** button and when ready click the **Update** button to re-run the search.