cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect and partial total result by lucene query

epaoletti
Champ in-the-making
Champ in-the-making
Hi,

We are running the following lucene query via action

query = "PATH:\"/app:company_home/cm:Test/cmSmiley Very Happyocument//*\" AND @\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:application/pdf";
So we would like to get the total number of pdf files under the "company_home/Test/Document" space.

We had the following issue:
– the first results of the query was not complete. we had not the correct total number
– so we run again the query until we get the correct total number of pdf files

So the query seems to return the correct total number only after we run it more than one time (times depend on number of PDF files in the space).
for example: if we have about 5.000 files
the first query shows total=1.500 files
the second one shows total=2.410 files
………
Until the last one shows=5.000 files
then the queries became stable and result is 5.000.

There is some configuration parameters for the Lucene query to avoid this problems ?
We would like to have the correct total number at the first query.

Thanks for your help
11 REPLIES 11

tcld0
Champ in-the-making
Champ in-the-making
You can also bypass security checks in your code by running as the system user or using the searchService instead of the SearchService.

Hi,
could you please elaborate on how i can run a query that bypasses security checks?  I'm writing an API into the repository that can be used by other systems to query for large batches of content nodes.  I don't want there to be any limits on the number of records that could be returned, as the use cases specifically require the possibility of returning all nodes in the repository.  Also, is there any way to know (programmatically) that a query has been cut short and has not returned all possible matching nodes due to some limit or timeout?

thanks

dgenard
Champ on-the-rise
Champ on-the-rise
Hi epaoletti,
using the SearchService in Java, there is a way to detect that a limit (maxPermissionCheckTimeMillis or maxPermissionChecks) was reached.
We use this to display a warning for the current user.

Example code :

ResultSet results = this.getSearchService().query(sp);
if (LimitBy.NUMBER_OF_PERMISSION_EVALUATIONS == results.getResultSetMetaData().getLimitedBy()) {
    searchLimitReached = true;
    Utils.addErrorMessage(Application.getMessage(FacesContext.getCurrentInstance(), "warning_search_limit_reached"));
} else {
    searchLimitReached = false;
}

Denis
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.