(8.1.3) Advanced search with PQL (Project query language)
The instructions on this page describe how to define and execute a search in the project navigator using advanced search with our autocomplete suggestions. You can also define and execute a search using basic search.
What is advanced search with autocomplete?
An advanced search in the project navigator allows you to use structured queries to search for projects. But how does the autocomplete feature works? (you might be asking yourself) Well, This means that at the moment of building a PQL, Projectrak will suggest values, keywords, and operators, that upon selection, will complete your PQL as you need.
Performing an advanced search with autocomplete
As an example, we would like to see what Projects are on a "PREPARING" Status in the "Apps Management" Category.
- Go to Projectrak → Project navigator.
- Click on the Advanced link to switch to advanced search.
- Type any field you would like to filter through, "Status" for example.
- Immediately, below the search bar, you will see autocomplete's suggestions for connectors upon that field. We'll choose equals to (=).
- In this case, we'll choose "ON TRACK" just by clicking on the suggestion.
- To filter through our projects, even more, we'll choose "Lead", which has already been suggested by autocomplete.
- We'll connect that field with another equals to (=) and select the suggested value: "currentUser()".
- Our PQL is completed and we can now click on the magnifying glass that will show us our result.
You can see how easy this can be in the video below.
When you perform an advanced search, you are using the Project Query Language (PQL), and autocomplete will suggest upon your selection.
A simple query in PQL consists of a field, followed by an operator, followed by one or more values. For example, the following simple query will find all projects whose Technology ( id=23 ) is "Java":
Technology = "Java"
Switching between advanced and basic search
In general, a query created using basic searching will be able to be translated to advanced search (i.e. PQL), and back again.
However, a query created using advanced search may not be able to be translated to Basic Search, particularly if:
- The query contains an OR operator (Note: You can have an IN operator and it will be translated, e.g.
project in (A, B)
) - The query contains the same field two or more times
- The query is too complex to translate to Basic Search
Setting the precedence of operators
You can use parentheses in complex PQL statements to enforce the precedence of operators or you can let autocomplete suggest it for you and choose it simply by clicking on it.
For example, if you want to find all development projects where Country is China or Continent is Asia:
category = development AND ( Country = China OR Continent = Asia )