cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene query problem

beslan
Champ in-the-making
Champ in-the-making
Hi,

I am using SDK 4.2.b and java api. When I call a lucene query like below, it takes 5 minutes and there are only 4 contents.

In alfresco.log I saw lines about lucene index cleaner.I added log file.

Any suggestions.


      SearchParameters searchParameters = new SearchParameters();
      searchParameters.addStore(spacesStoreRef);
      searchParameters.addSort(orderBy, !descending);
      searchParameters.setQuery(query);
      searchParameters.setLanguage(SearchService.LANGUAGE_LUCENE);
      searchParameters.setMaxPermissionCheckTimeMillis(30000);
      searchParameters.setMaxPermissionChecks(100000);

      ResultSet results = this.getServiceRegistry().getSearchService().query(searchParameters);


Thanks,
Beslan
8 REPLIES 8

abarisone
Star Contributor
Star Contributor
Hi,
you may force to rebuild index and take a look to how much memory you gave to Alfresco for startup…
Could you provide an extract from Alfresco.log?

Regards,
Andrea

beslan
Champ in-the-making
Champ in-the-making
Hi,

I did a full reindex.

JVM memory parameters are MaxPermSize=512m -Xms256M -Xmx3500M

I added alfresco.log. <a>https://forums.alfresco.com/sites/forums/files/alfresco_2.txt</a>

Thanks.

why are you doing this?
searchParameters.setMaxPermissionCheckTimeMillis(30000);
searchParameters.setMaxPermissionChecks(100000);

This is not required unless you have very large resultset.
Also could you post your query?

beslan
Champ in-the-making
Champ in-the-making
Yes I have very large resultset. But I will limit the resultset to 500;


+PATH:"/app:company_home/cm:archive//*" AND  @\{http\://www.uz.com/metadata\}contentModel:'8295ae0a-8e1d-4a90-ba37-20fff0b4c1a3" AND  @\{http\://www.uz.com/metadata\}Ada:'5115" AND  @\{http\://www.uz.com/metadata\}Parsel:'1"



Thanks,
Beslan

jpfi
Champ in-the-making
Champ in-the-making
Hi,
PATH queries with "//*" are very slow if you use LUCENE search subsystem.
You should try to avoid such PATH entries if possible.
Cheers, Jan

mitpatoliya
Star Collaborator
Star Collaborator
Yes, make it more targeted
also one more thing are you using any clustering?
Also if any one of the space huge number of documents it is advisable to categories them and distribute them among the subfolders.

beslan
Champ in-the-making
Champ in-the-making
Hi,

Removing PATH is the key. Everything is fine now.

Thanks,
Beslan

andy
Champ on-the-rise
Champ on-the-rise
Hi

Are you using SOLR or the lucene search subsystem.
SOLR is much faster at this sort of PATH query.

Andy