If the query is a very selective one, you can go through the XML document and do the counting.

If the query is not so selective, which is usually the case, and the number of matches are large, basically all the values need to be loaded into memory, or solid state disk, to do a fast counting.

--
Chris Lu
-------------------------
Instant Scalable Full-Text Search On Any Database/Application
site: http://www.dbsight.net
demo: http://search.dbsight.com
Lucene Database Search in 3 minutes: 
http://wiki.dbsight.com/index.php?title=Create_Lucene_Database_Search_in_3_minutes
DBSight customer, a shopping comparison site, (anonymous per request) got 2.6 
Million Euro funding!


Henrik Hjalmarsson wrote:
Hello
I am trying to develop an API for a search application that is using Lucene 2.4.1
The search application is maintained by RAA (swedish goverment organization 
that keeps track of historical and cultural data).
I have gotten a demand for an API method that returns an XML response, listing all the indexes in this application and the number of unique values these indexes can have, filtered by a query that is recieved in the method request. The application contains a large amount of indexes and some indexes contains a very large amount of unique values. Is there some way to achive this in an effective way? With regards Henrik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to