Getting Started (PI Web API Indexed Search)

PI Indexed Search and PI Indexed Search Crawler are optional features of PI Web API. Indexed search runs as part of PI Web API, while the crawler is an independent service. The crawler service gathers metadata from the PI System and provides items for the indexed search service for indexing. The crawler service may be installed locally or in network proximity to a PI System. Only a single instance of the crawler service runs on a machine, however multiple machines may be configured to run this service. The crawler service periodically gathers metadata from which to build and maintain indexes to improve the performance of commonly used queries.

The values that are always indexed are names of PI points, AF elements, attributes, templates and categories, descriptions, the unit of measure, and data type. You can configure other point attributes to be indexed, for example, you might want to filter your data by pointsource, exdesc, or location1, and so on. This configuration may be viewed or modified on the Settings page.

This guide assumes you are already familiar with the information in the PI Web API Getting Started Topic. This topic will give a brief overview of how to set up the PI Web API Indexed Search and how to create ad hoc queries for data gathering.

For more information, please review the PI Web API User's Guide, PI Web API Release Notes, and the help topics in the left margin of this page.

Indexed Search Crawler Quick Start

Before you can take advantage of PI Web API Indexed Search you need to configure one or more source databases for the crawler to process. This can be done from the Databases page.

Click + Add Database and in the textbox type the name of the PI Server name (ex. pi:MyPIServer) or AF database path (ex. af:\\MyAFServer\MyAFDatabase). By default, the local machine crawler service is used if not specified.

Once configured the crawler will index the metadata present on that server and will let you know when complete by giving you a last crawled time.

You are now ready to create your first query.

Please refer to the help topic PI Web API Indexed Search: Crawler Configuration. for more information regarding the crawler and setup.

Note: The crawler service can index only PI Servers that are configured with identity mappings, which are supported by PI Server version 3.4.380, or later. At a minimum, you could, for example, use PI SMT to create a mapping from \Everyone to pidemo. The crawler service cannot be used with earlier versions of PI Server.

Ad Hoc Querying Quick Start

The strength of the PI Web API Indexed Search is with the ability to quickly create searches for metadata on a PI or AF Server. Some examples of data you can retrieve through this interface are:

With the database configured and crawled, navigate to the following address:
https://localhost/piwebapi/search/query
You will notice an error message in a a JSON object stating that "Query parameter must be specified".

We will now give a parameter to our search query. In the address bar of your browser enter the following address:
https://localhost/piwebapi/search/query?q=name:*

After you hit return you will get results for all the items in all of your configured databases. This is a generic search asking for all results with any name. You can refine this search by stating a specific name for a field. For instance if you have the pre-installed PI Points you could search for the PI Tag with the name "Sinusoid" with the following query:
https://localhost/piwebapi/search/query?q=name:sinusoid

Please refer to the help topic PI Web API Indexed Search: Search Queries for more details and examples.

localhost.osisoft.int
Enabling Operational Intelligence