cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice lucene Search Problem

alvisccc
Champ in-the-making
Champ in-the-making
Hi everybody,

I am using webservice api to perform a simple lucene search,the code looks like this:


Query query = new Query(Constants.QUERY_LANG_LUCENE,"PATH: \"//app:company_home/cm:"+ISO9075.encode

("loadTest")+"//*\" "  +  " AND TYPE:\"customSmiley TongueatientRecord\"");

QueryResult queryResult = WebServiceFactory.getRepositoryService().query(STORE, query, false);


It spent lots of time(about 1 min ) in querying the folder loadTest if the folder contains 10000 documents.If folder contains 1000 documents,searching time is about 10 secs.The queryResult.getResultSet().getTotalRowCount() equals 10000,is that means the query is searching all the documents

under loadTest folder ? If yes, are there any methods that can be shorten the searching time.For example only search first one thousand(1000) documents and then return queryResult?

i can't find out a solution that can limit the searching operations by adding parameter to lucene query string ,in java code or even configuartion files in alfresco.Please help me !

Thx

Best Regards,
Alvis
5 REPLIES 5

openpj
Elite Collaborator
Elite Collaborator
You can limit Alfresco search engine using these properties:

The maximum time spent pruning results
system.acl.maxPermissionCheckTimeMillis=??????
# The maximum number of results to perform permission checks against
system.acl.maxPermissionChecks=????
or using from the Java API the org.alfresco.service.cmr.search.SearchParameters  set the limit and limitBy properties on a per-query basis.

You can find a previous thread here:
http://forums.alfresco.com/en/viewtopic.php?f=13&t=17277&p=77107

Hope this helps.

alvisccc
Champ in-the-making
Champ in-the-making
But "org.alfresco.service.cmr.search.SearchParameters" API ,can it be use inside webservice and alfresco server is started?
thanks

swardi
Champ in-the-making
Champ in-the-making
Hi,
i see that the search works in your application, i have a same scenario. i have a space structur like this a space  A and subspaces (a1, a2, a3, …). i wannt to select all documents stored in a1 or a2 or a3. How can i do that. How is the query.

Thanks.

mrogers
Star Contributor
Star Contributor
If you want "all documents in a space" then its much better/faster to use the node service directly and ***NOT*** use a query.   There are methods to list all documents within a space in the Java and JavaScript APIs.

swardi
Champ in-the-making
Champ in-the-making
Hi,
thanks for your answer. I am using the web services API. Do you habe any example how to get all documents in a space via web services API?.

Thanks.