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.
Search entities by keyword
When you search a knowledge graph, the criteria you provide are evaluated against all indexed properties of all entity types by default. The search results 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 url property.
- Open an investigation and browse its content.
- At the top of the investigation view, click in the search text box or press Ctrl+F and click Search, if needed.
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.
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 in which a text property contains both the words drive and truck.
- You can find graph items in which 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 in which the word truck is present specifically in the note property, you would use the syntax note:truck. To find graph items in which a phrase exists in the note property, use the syntax note:"drive a 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.
What you can search
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.
To find entities in which a specific property contains a value or entities connected with specific relationships, consider exploring your data with histograms or writing an openCypher query instead.
Modify and update search results
Once you can see an initial set of search results, you often realize you need to refine your search terms.
- Click in the search text box or press Ctrl+F.
The search control appears and lists other similar searches in your search history that you can run again. The control will also list the first three graph items returned by the current search for reference.
- Update the text of the existing search criteria, for example, by typing new or removing existing characters or adding another keyword. Press Enter to run the search.
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 that were performed.
- 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 Remove From History button to remove a search from the search history.
The specified search is removed from the list. Your search history is updated to show the three most recent searches.
- Click a search in the list to run it again.
Find specific entities and relationships
Instead of searching only entities, options are available that allow you to search only relationships or both entities and relationships. Also, you can be selective about which entity types or relationship types you want to target with your search.
- Click in the search text box or press Ctrl+F and ensure Search mode is selected.
- Click the Show/Hide Advanced Options button .
The Advanced Options toolbar appears below the search text box.
- Click the Scope drop-down list and click one of the available options to search entities, relationships, or both, with the provided 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.
- 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 next to the search text box to rerun the current search with the new options.
According to the selected scope, entities and relationships of the specified types that match the search criteria are included in the search results and appear in the investigation's contents list.
- To hide the advanced search options toolbar, click the Show/Hide Advanced Options button .
The Advanced Options toolbar is hidden.