5 Replies Latest reply on May 4, 2016 1:22 PM by gregor

    Issue with the Search Query in piwebapi, some PI tags do not return any data


      Hi we created 6 PI tags all with attributes in PI AF. When we try to search for those tags using the search query in piwebapi, some of the tags do not return any data.


      Here is the result from the following API call for tag 21-HG-411 it does not find any item.

      Api call: https://myserver/piwebapi/search/query?q=name:21-HG-411




        "Links": {

          "Next": "https://osisoft.vm.cld.sr/piwebapi/search/query?q=name%3A21-HG-411&count=10&start=10",

          "First": "https://osisoft.vm.cld.sr/piwebapi/search/query?q=name%3A21-HG-411&count=10",

          "Last": "https://osisoft.vm.cld.sr/piwebapi/search/query?q=name%3A21-HG-411&count=10&start=0"


        "Errors": [],

        "Items": []



      Thank you for your help on this,



        • Re: Issue with the Search Query in piwebapi, some PI tags do not return any data
          Marcos Vainer Loeff

          Hi Ralph,


          As you are using the Search controller, we need to check if the PI Web API Search Crawler is working properly. Is this working for other PI Points/Elements from the same PI Data Archive/PI AF Server? Or is this problem specific related to those 6 PI Points?


          Please visit the administrative page https://yourwebserver/piwebapi/admin/search/database.html and make sure if all databases are crawler properly. If they already are crawled, please try to rebuild them and try to query again.


          PI Web API 2016 was just released so I strongly recommend you to upgrade it as many known issues related to indexing are fixed.

          Finally, if this problem persists, the best way to proceed is through OSIsoft TechSupport as they have more tools to deal with this kind of issue.


          Hope this helps!

          • Re: Issue with the Search Query in piwebapi, some PI tags do not return any data

            Hello Ralph,


            We have been in contact by email already regarding your issue. Thank you for posting it here.


            You have anonymized your query but not the URL's in the response. Also the screenshot of PI System Explorer shows the name of your AF Server and the AF Database. If this is sensitive information, please consider generalizing or making certain pieces invisible.


            Because your query uses search, a requirement to return correctly is that PI Index Search Crawler has successfully crawled eVision AF Database. Please verify the Crawler status by looking at Search Service Administration page e.g. https://myserver/piwebapi/admin/search/database.html


            An alternative approach to look for the Element requires the AF Databases WebID but you can easily browse to it as follows:

            • Start at https://myserver/piwebapi/ and click the AssetServers link
            • Locate your AFServer if there show multiple and click the Databases link
            • Locate your Database and click the Elements link which will bring up a list of the root Elements for the selected AF Database
            • Copy the URL, add the following to the end ?nameFilter=21-HG-411&searchFullHierarchy=true and hit [Enter] to execute
            • The response should now show your Element. Please verify the Path and select from the choice of links e.g. Attributes

            With this you are "browsing" PI Web API until you get the desired information and even programmatically possible it demonstrates the power of the Index Search Crawler. So it's definitely worth fixing possible issues with the Index database.