Viewing ACL Information When Debugging

About this task

Search results are normally viewed in HTML, but can also be viewed in raw, un-rendered XML by adding the v:xml=1 CGI parameter to the URL for your query. As discussed in the Watson™ Explorer Engine documentation, any administrative user can add this parameter to any query to an application in order to be able to examine the actual XML code that is being returned by a query.

While you are developing an application, it is very useful to be able to display raw search results to ensure that all of the information that you are looking for is actually being returned by your queries. This is especially useful when developing and debugging search applications that use authentication to determine which users should be able to see certain results.

After performing a search and adding &v:xml=1 to the end of the URL, press return to display the XML version of your search results. Use your browser's search capabilities to scroll down to the document nodes, which are the elements that actually contain the results. The cache node associated with each document element, as shown in Figure 1 will include an acl attribute that shows a list of ACLs for that document element. You may have to scroll your browser window to the right to see the acl attribute.

Figure 1. Viewing ACL Detail in XML Search Results

For testing and verification purposes, you can also activate an option to display detailed ACL information in the index for a remote resource, such as an SMB fileshare, that you are crawling. This option causes the search engine to output ACL information at both the document and the content levels. For performance reasons, this should only be done during development and testing, and never in a production system.

Providing more detailed ACL information is done from your search collection's Configuration tab:


  1. After selecting this tab, select the Searching sub-tab and click edit to edit the indexing options.
  2. Scroll down to the Debugging section, and set the Output ACLs option to true.
  3. Scroll back to the top of the page and click OK to save your changes.
  4. Restart the indexer service by clicking the restart link in the yellow box at the top of the page.
  5. Enter a sample query such as "test" in the query text area under the Test with project label in the Watson Explorer Engine adminstration tool's left-hand navigation bar, and click Search.


Once search results are displayed, position the cursor in the URL/address bar, add &v:xml=1 to the end of the URL that returned these results, and press return. Your browser will display the unformatted XML that was returned by the search application, prior to converting it to HTML and rendering the page. This screen should contain XML code that looks much like that shown in Figure 2.

Figure 2. Viewing Additional ACL Detail in XML Search Results

To actually see per-result ACL information, you can use your browser's internal search capabilities to search for the string default-content-acl. Each document element will include a default-content-acl attribute that defines the ACLs associated with that search result in the data that you crawled to create the search collection. As the name suggests, all content elements default to this value, unless your search application implements logic to identify specific content elements and change their ACL information.

Important: As mentioned earlier in this section, you should disable the Output ACLs option once you are done verifying that all ACLs are being successfully retrieved.

To disable this option, return to the search collection's Searching sub-tab, click edit, and set the Output ACLs option to false. You must then click OK to save your modified settings, and restart your indexer service to stop this information from being returned.

To proceed with this tutorial, click Creating a Project.