The Search API provides a way to search MongoDB databases, as long as your data is properly exposed to the Itential Platform search engine. This guide explains how to set indexes and expose your data collections using search objects.
Only use this guide to modify custom applications. Do not modify or update Itential applications.
A database collection can be searched if it is exposed with a search object. This search object is added to the pronghorn.json file and consists of an object, or array of objects, following the schema below.
Empty search template
Search exposure object
Currently, only text-based fields ("type": "string") are supported for searching.
You must create the appropriate indexes for your fields to be search-enabled. MongoDB uses compound indexes — list each field name followed by 1 as the value.
The compound index must match the fields in the search template. For example, if you want to search on name and type, you must have a compound index on both fields.
To create an index against a local instance for testing, run the following in a MongoDB collection browser. This example creates an index on the MOP templates collection for name:
Follow these guidelines when creating indexes:
background to true when creating indexes to support performance at scale.The POST body consists of a data object with a text property containing the value to search for.
Empty request
Search object example (searching for the word workflow):
Results follow the map object configured above, with the addition of _id and tags fields:
Top-level result fields
Result group fields
Individual search result fields
The following Itential applications already have search objects and indexes configured:
The Search REST API is currently used only by the site-wide search box in the top navigation bar. You can, however, use the results in your own application if needed.