VERIFIED SOLUTION i
X

Troubleshooting MAXHITS parameter settings in Vault web applications

Issue

When searches for documents that return many similiar results are performed, sometimes Vault will "loop," returning the same results many times.

Cause

By default, Vault searches are limited by the MAXHITS settings. If a search has more than MAXHITS results that match, then the Vault search will use a specific key as a form of results cursor to resume a search to keep within the MAXHITS limit . If the index contains duplicate keys (e.g. large numbers of duplicate dates) this may cause the search to resume in the wrong place (or even cause the search call to loop).

Resolution

UPDATED: September 26, 2017


Troubleshooting MAXHITS  parameter settings in Vault web applications
 
Background
Vault  web client applications (ServiceWeb2, PERL web client) have parameters of maxhits which are used to control the number of account index search results and document index search results or documents displayed inside document date DROPDOWN list box when choosing a specific document. They can be set up on server side and client side. General speaking it is enough to use default values.
Settings on server side
maxhits : The maxhits setting defines the maximum number of hits to return from a search request when the requesting client does not set  it (request.max parameter in the wire search API). The default is 30.
 
Notes:
• Increasing the number of hits can increase the amount of work the server needs to do to execute a search. In some cases this can have significant performance implications for the server (see "Search performance considerations" in Vault Customizing Guide).
• By default, a Vault searches are limited by the MAXHITS settings.  If a search has more than MAXHITS results that match, then the Vault search will use a specific key as a form of results cursor to resume a search to keep within the MAXHITS limit . If the index contains duplicate keys (e.g. large numbers of duplicate dates) this may cause the search to resume in the wrong place (or even cause the search call to loop). Increasing the default number of hits can reduce the need for this mechanism. For the latest versions (7.0 and later versions), Vault is using the skip and take features to do the search, so it will not have this looping issue.
• Older versions have different defaults or internal hard coded values for this control.
 
maxcap : The maxcap setting defines the highest number of matches (request.max parameter in wire search API)  the database component will allow in a request. The default is 10000.
 
Note: Older versions had different defaults or internal hard coded values for this control.
 
Before the versions of 5.4, the settings are inside server.ini, after 5.4, these settings are in the section of database1 in e2serverd.ini
E2serverd.ini

[database1]
Maxhits=30
maxCap=10000
You can change the default values and restart e2serverd.
But default values are enough for common using.
 
Settings on client side
The search results display pages for ServiceWeb2 and PERL web client are similar. The page images attached here are from 7.1 ServiceWeb2, but for the PERL sample, they are similar.
Search result (for Accounts and Documents):
Document date DROPDOWN list box:
 
How to set up the parameters
Parameters for .NET API
Inside .NET API, the main class is RenderClient2 which is used to retrieve information from server.
The search methods in RenderClient2 (i.e. RenderClient.search*() , RenderClient2.document*() ) are using resume (cursor key) model to do the search which might cause looping issues. You can set a bigger value for the maxresults parameter to avoid the problem. From 7.1, .NET API has a new service class of Command and some specific command classes (i.e. AccountCommand, DocumentCommand) which are using  the skip and take model  to do the search which will not have the looping problem. These new service classes should be used if possible.
 
Parameters on Java API side
Inside Java API, the main class is VaultClient which can be used to retrieve information from server side.
The methods of VaultClient.search*() (from Vault 7.0m2p0019) are using skip and take model to do and search process which will not cause looping problems on server side and client side.
Other methods such as VaultClient.getDocumentEx*(),  VaultClient.getAll*(), Database.searchFor*() and Account.getDocuments() are using resume key to do the continuous search which might cause looping issue on server side and client side. For all of these methods, there is a parameter of maxResults which is used to control the wire protocol parameter of request.max. You can set up a bigger value of maxResults to avoid the looping problem.
So the methods of VaultClient.search*() are recommended to use.
 
Settings for ServiceWeb2 :
ServiceWeb2 is a Java based web client example (based on Java API). Prior to 7.0M2p0019, ServiceWeb2 is used the resume (cursor key) key model to do the search which might cause a looping issue. After 7.0M2p0019, the skip and take model is used in ServiceWeb2 for searching.
For ServiceWeb2, all of the parameters are inside web.xml, it is in ServiceWeb2.war. After unzip the ServiceWeb2.war you can find it in <ServiceWeb2>\WEB-INF\web.xml.
Or after deployed inside a web server (i.e. TOMCAT), you can find the file from  <TOMCAT>\ServiceWeb2\WEB-INF\web.xml.
Open web.xml with any xml editor or text editor, you can find out below settings:
    <context-param>
        <description>Maximum number of search results to display.</description>
        <param-name>maxresults</param-name>
        <param-value>20</param-value>
    </context-param>
    <context-param>
        <description>Maximum number of document retrieving </description>
        <param-name>maxHits4Document</param-name>
        <param-value>100</param-value>
    </context-param>
These two parameters are related to the parameter of maxhits on server side. These set the request.max parameter in search requests sent to the server for their respective search commands.
 
The parameter of “maxsesults”  is for the maximum results setting when doing search (searching accounts and documents).
The parameter of “maxHits4Document” is for the maximum results setting when getting document list for document date dropdown list box.
Change  the values and restart TOMCAT, you can get the new settings.
 
Settings for PERL web client:
From 7.0, PERL sample is using skip and take model for the search.
 
Perl sample provides these two settings in <scripts>\interface.pl:
 
my $maxhits=20
 
This setting controls the maximum number of hits requested in searches (account searches and document searches)
 
my $maxdocs=100
 
This setting controls the maximum number of hits returned for the date drop down box on the document date DROPDOWN list box page.
These set the request.max parameter in search requests sent to the server for their respective search commands.
 
URL for web clients :
The port number is 8080 for web server, i.e. TOMCAT:
For ServiceWeb2 : http://localhost:8080/ServiceWeb2
 
The port number is 8080 for web server, i.e. Microsoft IIS.
For PERL sampel : http://localhost:8080/scripts/interface.pl

Downloads

  • No Downloads