Use advanced search tools

If you need to do more than just find a component, you can use advanced search tools to create logic that asks a question about the data in your components. For simple inquiries, you can enter a combination of unique words or phrases and use the And, Or, and grouping features to find more exact matches. For more sophisticated inquiries, you can use the Advanced Content Query Builder to write XPath expressions to search your XML documents. Advanced searches are slower than a content search but they give you more flexibility for finding exact matches and structural conditions.

You can also search for XML code and attributes using the Find Duplicate Content search feature.
  • You can search through all components in a folder to see if there is XML content that is used repeatedly.
  • Follow the steps in Find duplicate content.

Specify where you want to search

In the Components pane, regardless of whether you are creating an advanced query or doing a basic search, you can choose one of the following folder options to search in:

  • Current Folder
  • Current and Subfolders
  • All Folders

If the content you need to run an advanced query on is split up across different folders with different sets of permissions, and you don't want to search all folders, you can select the individual components to perform an advanced search on.

Before you open the Advanced search pane and enter your query, you can select the components you want to search in.

  • When you see them listed in the Selected Components pane, you can go to the within field choose Selected Components.
  • Then you can open Advanced search and build your query.
  • When the advanced search is run, Inspire looks only in the selected components.

For more details, read Use advanced search on components instead of folders.

Build queries

You can use the advanced search feature to build queries.

Use operators and parameters
To enter a combination of unique words or phrases, you can use the operators (And, Or) and grouping features (), and add multiple parameters to find more exact matches.
Find elements
You can build queries to find an element and see a list of all its values. This is useful if you want to check that the correct values are being used for an element.
Use the advanced content query builder

You can also write XPath expressions for greater search flexibility and to search for structural conditions, For example, you can write an XPath expression to find all table titles where someone used the actual word "table". To search for this you would enter the following XPath expression:

//table/title[contains(.,"table")]

Sample XPath expressions

XPath is a language that reads an XML document as a tree of nodes. You can use an XPath expression to navigate through and select nodes from a document.
  • There are various types of nodes, including element nodes, attribute nodes, and text nodes.
  • XPath defines a way to compute a string-value for each type of node.

XPath defines a library of standard functions for working with strings, numbers, and boolean expressions. Some of these functions include:

Child
Selects all children of the root node
child::* - ..//name
Name
Selects all elements having the name "name", descendants of the current node.
.//name

You can use the following examples of XPath expressions to understand how to build your own queries:

Search all elements for text that contains "area management"
//*[contains(.,"area management")]
Search all elements text that equals "area management"
//*[. = "area management"]
Search all phrases for text that contains the phrase "area management"
//ph[contains(.,"area management")]
Search all phrases for text that equals "area management"
//ph[. = "area management"]
Search all platform attributes for a value that contains "mac"
//*[@platform[contains(., "mac")]]

To learn more about XPath, refer to the following documentation: