AnsweredAssumed Answered

Search performance issues using searchService

Question asked by lista on Oct 1, 2012
Latest reply on Oct 9, 2012 by lista
Hi all,

i have about 70k nodes, under a structure like this:

-main space
–subspace based on node's first character

Searching for a specific node is a practically instant through Alfresco Explorer, but when using API it takes about 7 seconds (just to show the difference).
Here's the concrete code at fault:

SearchParameters parameters = new SearchParameters();
parameters.addSort("@" + sortQName, sortIsAsc);

results = searchService.query(parameters);

Lucene query is basic, nothing complicated, and Alfresco in play is 3.4.

The interesting part comes now; when I remove the sort part, it works almost as fast as through Alfresco Explorer, and it definitely stops being a performance issue.
How do you explain this, and does anyone have any concrete advice?