Hi ,all
    I'm using 4.10.3, as András Péteri mentioned, i tried the Collector, and 
looked into the source code. It seems that the collector i rewrite and the 
default TopScoreCollector just collects the docs, but the socre and weight is 
still calculated, so it didn't speed up the search. Maybe i used the wrong word 
'ignore', what i want is total disable the socre and weight in search, i just 
want the posting list to be returned.

At 2015-07-30 19:34:17, "András Péteri" <apet...@b2international.com> wrote:
>Collector's javadoc in Lucene 4.x includes a bare minimum example which
>only registers matching documents in a bitset:
>https://github.com/apache/lucene-solr/blob/lucene_solr_4_10_4/lucene/core/src/java/org/apache/lucene/search/Collector.java#L85
>
>You'll have to adapt this if you want to use it in Lucene 5, though, as the
>interface changed slightly.
>
>
>
>On Thu, Jul 30, 2015 at 12:49 PM, Alan Woodward <a...@flax.co.uk> wrote:
>
>> What version of lucene are you using?  From Lucene 5.1 you can tell
>> queries to not report scores, which will give you the speedup you require
>> here.
>>
>> Alan Woodward
>> www.flax.co.uk
>>
>>
>> On 30 Jul 2015, at 05:22, 丁儒 wrote:
>>
>> >
>> >
>> > It seems that ConstantScoreQuery use the Weight and Score of  the Query
>> it wrapperd, like TermWeight and TermScorer , so it can't speed up the
>> search, because the weight and score is still calculated. Maybe i make it
>> wrong, but i did some test, the search time of ‘ new ConstantScoreQuery(new
>> TermQuery)’ is the same as 'new TermQuery'.
>> >
>> >
>> > At 2015-07-29 21:56:22, "Jack Krupansky" <jack.krupan...@gmail.com>
>> wrote:
>> >> ConstantScoreQuery is the proper approach. What specific failure did you
>> >> encounter?
>> >>
>> >> -- Jack Krupansky
>> >>
>> >> On Wed, Jul 29, 2015 at 7:09 AM, 丁儒 <bfore...@126.com> wrote:
>> >>
>> >>> Hi, all
>> >>>    Currently i'm using lucene. But i don't care the score and weight, i
>> >>> just need the documents meets the query. I tried some way to ignore the
>> >>> score, like rewrite TermQury, disable the TermWeight and TermScore, but
>> >>> there are a lot of queries, and this is  incompatible with QueryParser.
>> >>> Also i tried ConstantScoreQuery and tried to rewirte
>> ConstantScoreQuery,
>> >>> but failed. So is there any way to ignore soce in search to speed up
>> the
>> >>> search.
>> >>>
>> >>> Thank you!!!
>>
>>
>
>
>-- 
>Péteri András

Reply via email to