Each knowledge graph has a Lucene index that is created and maintained automatically. It allows you to search for entities and relationships using the content stored in some properties.
By default, all properties on all entity types and all relationship types are indexed if they have the Text data type or the Globally Unique Identifier (GUID) data type. This includes the value of the Document entity type's text property, which can contain notes that you typed or text extracted from the file associated with a Document entity.
When you modify the value of a property with the Text or GUID data type and save your changes, the modified value is immediately updated in the index and available for a search. This includes the update that occurs when you click Extract Text because the referenced file's contents were updated.
Search syntax
In general, you can use the same syntax to search for entities and relationships in a knowledge graph as when you search for project items in the Catalog pane or the catalog view, and when you perform an advanced search in an ArcGIS Enterprise portal. Consider the following examples:
- Perform a keyword search by typing drive. All graph items with a text property containing the words drive, driver, and driving are found by the search.
- You can refine your results by adding a word. Providing two words such as drive truck will find graph items where a text property contains both the words drive and truck.
- You can find graph items where a property contains one word or the other by adding the Boolean operator OR, as with drive OR truck.
- To find graph items with text properties that contain a specific phrase, the appropriate words must be enclosed in quotation marks, such as "drive a truck".
- To look for entities and relationships where the word truck is present specifically in the note property, you would use the syntax note:truck.
While user-defined properties with the GUID data type are indexed and searchable by default, the system-defined and maintained property globalid is not. The value for this property is indexed, but you can only find a graph item by its globalid value by searching this specific field, for example, globalid:9612603C-D3A5-49B6-8631-B8A79234BC49. GUID values are displayed in an investigation's details panel enclosed in braces, such as {9612603C-D3A5-49B6-8631-B8A79234BC49}. You can search for a graph item using a GUID enclosed in braces by placing the entire string in quotation marks, for example, globalid:"{9612603C-D3A5-49B6-8631-B8A79234BC49}".
Many other advanced searches are possible using the standard Lucene search syntax.
Search for entities and relationships
When you search a knowledge graph, the criteria you provide are evaluated against all properties of all entity types by default. The search results that appear in the investigation indicate the entity found by the search, its entity type, and the individual properties whose text satisfied the search criteria.
In the example below, a keyword search using the word cookie found two entities in the knowledge graph. One entity has the entity type Pet, and the other is a Document entity. Two properties of the Document entity had text that satisfied the search: the name property and the text property.
Options are available that allow you to search only relationships or both entities and relationships instead of searching entities only. Also, you can be selective about which entity types or relationship types you want to target with your search.
- Open an investigation and browse its content.
- At the top of the investigation view, click in the search text box or press Ctrl+F.
The search control appears.
- Type a keyword in the text box and press Enter.
Entities that match the specified search criteria appear in the investigation's contents list.
- Click the Advanced Options toggle button to the left of the search text box.
The Advanced Options toolbar appears below the search text box.
- Click the Scope drop-down list and click one of the available options to find entities, relationships, or both, with the provided search criteria. For example, click Entities and relationships.
- Entities—Compare the search criteria to properties of all entity types in the knowledge graph.
- Relationships—Compare the search criteria to properties of all relationship types in the knowledge graph.
- Entities and relationships—Compare the search criteria to properties of all entity types and all relationship types in the knowledge graph.
- Click the Start Search button to the right of the search text box to run the same search but against a different collection of graph items.
Entities and relationships matching the specified search criteria appear in the investigation's contents list.
- To narrow the searches to specific entity types or relationship types, click the Types button .
- In the drop-down list that appears, check all entity types and relationship types you want to search. You can start typing the name of an entity type or a relationship type that you want to select; the list of types is filtered automatically, and you can check the types you want to search in the filtered list.
If the scope of the search is entity types, only entity types are listed. If the scope of the search is relationship types, only relationship types are listed.
The total number of selected entity types and relationship types appears on the Advanced Options toolbar.
- Click the Start Search button to the right of the search text box to run the same search but against a different collection of graph items.
Entities and relationships matching the specified search criteria appear in the investigation's contents list.
- To modify the search criteria, click in the search text box. Modify the text of the existing search criteria, for example, by typing an additional keyword. Press Enter to run the search.
When you click in the search text box, the search control appears and lists other similar searches in your search history that you may want to run again. The control will also list the first three graph items returned by the current search for reference.
Entities and relationships matching the updated search criteria appear in the investigation's contents list.
- Click the Reset Search button in the search text box to clear the search and remove the results.
The graph items that were previously listed in the investigation view appear again.
- When the search text box is empty, click in the search text box to open the search control and list the three most recent searches. Click a search in the list to run it again.
The selected search is run and the results of the search appear in the investigation.
- Click the Reset Search button in the search text box to clear the search from the search text box and remove its results from the investigation. Click in the empty search text box to open the search control, and click the Remove From History button for a specific search in the list to remove it from the history.
The specified search is removed from the list. Your search history is updated to show the three most recent searches.
- If you no longer need the advanced search options, click the Advanced Options toggle button to the left of the search text box.
The Advanced Options toolbar is hidden.