Incorrect and partial total result by lucene query
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2009 07:03 AM
Hi,
We are running the following lucene query via action
query = "PATH:\"/app:company_home/cm:Test/cm
ocument//*\" 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
We are running the following lucene query via action
query = "PATH:\"/app:company_home/cm:Test/cm

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
Labels:
- Labels:
-
Archive
11 REPLIES 11

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 12:17 AM
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

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2009 02:43 PM
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 :
Denis
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
