AnsweredAssumed Answered

Perform count(*) with Lucene's query

Question asked by alf_kin on Jun 20, 2013
Latest reply on Jun 20, 2013 by alf_kin
Hi guys,
I'm facing with a hard job to do. I have to COUNT all the documents that match a specific query. The number of matching documents is around 100'000. My searchparameter is composed in this way:

                SearchParameters sp = new SearchParameters();
      sp.addStore(Repository.getStoreRef());
      sp.setLanguage(SearchService.LANGUAGE_LUCENE);
      sp.setQuery(finalQuery);
      sp.setMaxPermissionChecks(600*1000);
      sp.setMaxPermissionCheckTimeMillis(600*1000);
      sp.setLimitBy(LimitBy.UNLIMITED);
      sp.setLimit(0);
      sp.setMaxItems(-1);


This kind of query takes about 600000 ms to finish !!!(sometimes this time is not enough and resultset is incomplete :|). At the end of query i get resultset.length value. I'm using java-backend webscript to do this task. Are there other ways to go to reach the goal???

I'm groping into darkness…

thanks.
a.   

Outcomes