cancel
Showing results for 
Search instead for 
Did you mean: 

Optimize search

agey
Champ in-the-making
Champ in-the-making
Hi all,

We created custom code on Alfresco ECM 3.0 version, with our requirements to manage our documents. Now, the repository is too long and our custom code isn't as fast as we would like. We want to optimize lucene search to improve the speed.

We change lucene.indexer.mergeFactor property as indicated in http://wiki.alfresco.com/wiki/Index_Merging_Performance. But Alfresco has several ways to search a NodeRef from a path, we want to review the search method to select the faster. We are using this one:

example 1:

List<NodeRef> results = this.serviceRegistry.getSearchService()
      .selectNodes(rootNodeRef, xpath, null, this.serviceRegistry.getNamespaceService(), false);
results.get(0);


But, another ways to get the same result are:

example 2:

FileInfo folder = this.serviceRegistry.getFileFolderService().resolveNamePath(getBaseNodeRef(), pathElementsList);
folder.getNodeRef();


example 3:

List<NodeRef> results = this.serviceRegistry.getSearchService()
                .query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_LUCENE, xpath)";
results.get(0);


Could someone point me what is the best way to get the NodeRef of a node from its path? Is there any difference between them in terms of execution speed?

Thanks a lot in advance,
3 REPLIES 3

kaynezhang
World-Class Innovator
World-Class Innovator
lucene language is the fatest one ,all other language are converted to lucene language and search lucene index.

agey
Champ in-the-making
Champ in-the-making
Thank you. I will use lucene search. I hope that this will improve the speed of alfresco.

spilby
Confirmed Champ
Confirmed Champ
I'm searching the same answer… try to find the fast method to select a node. But I don't understand if example 1 or example 3 are the fastest. Both of them use Lucene search. What's the most efficient method?

Thanks!