Can't you just specify the length range as a filter query? If your length type is tint/tlong, Solr already has optimized code that uses multiple resolutions depth to efficiently filter through the numbers.
Regards, Alex. Personal website: http://www.outerthoughts.com/ Current project: http://www.solr-start.com/ - Accelerating your Solr proficiency On Tue, Apr 29, 2014 at 3:23 PM, 郑华斌 <huabin.zh...@qq.com> wrote: > Hi all, > > > My doc has two fileds namely "length" and "fingerprint", which stand for > the length and text of the doc. I have a custom SearchComponent that enum all > the docs according to the term to search the fingerprint. That could be very > slow because the number of docs is very huge and the operation is time > consume. Since I only care about the docs with the length within a close > range around that specified in the query, what's the right way to accelerate? > Thanks > > > DocsEnum docsEnum = sub_reader.termDocsEnum(term); > if (docsEnum == null) { > continue; > } > while ((doc = docsEnum.nextDoc()) != DocsEnum.NO_MORE_DOCS) { > // do something expensive > }