Ok, I was trying to do that. The problem is that I can't find the right
search method to use. Should I use _search or search?

I can see that there's is

void     _search (Query *query, HitCollector *results)

in

lucene:search:Searcher

But I can't use it when I am using a IndexSearcher, I thought it would
inherit that method from Searcher.





PS: Maybe the example could be changed (or removed of) the documentation?

On Wed, Oct 14, 2009 at 9:38 AM, Itamar Syn-Hershko
<ita...@divrei-tora.com>wrote:

>  Of course it does, this is Java not C++.
>
> In C++, what you'd do is derive your own class from HitCollector and
> implement the virtual function "collect" in it, something like:
>
> class MyCollector : public HitCollector {
>   void collect(const int32_t doc, const float_t score){
>             bits->set(doc);
>         }
> }
>
> If necessary, there are a few of those classes in the core
> (MultiHitCollector, SimpleTopDocsCollector and several more).
>
>  ------------------------------
> *From:* Onilton Maciel [mailto:oniltonmac...@gmail.com]
> *Sent:* Wednesday, October 14, 2009 3:25 PM
> *To:* clucene-developers@lists.sourceforge.net
> *Subject:* Re: [CLucene-dev] Score with no normalization
>
> The compiler complains about
>
> new HitCollector() {
>        public void collect(int32_t doc, float score) {
>          bits.set(doc);
>        }
>
> }
>
>
> On Wed, Oct 14, 2009 at 6:35 AM, Onilton Maciel 
> <oniltonmac...@gmail.com>wrote:
>
>> This one
>>
>>    Searcher 
>> <http://clucene.sourceforge.net/doc/html/classlucene_1_1search_1_1Searcher.html>
>>  searcher = new IndexSearcher(indexReader);
>>
>>
>>
>>
>>    final BitSet bits = new BitSet(indexReader.maxDoc());
>>    searcher.search(query, new HitCollector() {
>>        public void collect(int32_t doc, float score) {
>>          bits.set(doc);
>>        }
>>      });
>>
>>
>>
>> On Wed, Oct 14, 2009 at 4:23 AM, Ben van Klinken 
>> <bvanklin...@gmail.com>wrote:
>>
>>> Which example were you looking at?
>>>
>>> Using a hitcollector is probably the best way to go.
>>>
>>> ben
>>>
>>> 2009/10/13 Onilton Maciel <oniltonmac...@gmail.com>:
>>>  > Are there anyway to get the score of Hits class without the
>>> normalization? I
>>> > mean the raw value, not between 0 and 1.
>>> >
>>> >
>>> > I looked at the documentation. And thought HitColletor was the way to
>>> go.
>>> > But the example didn't work...
>>> >
>>> > Are there any other way?
>>> >
>>> >
>>> ------------------------------------------------------------------------------
>>> > Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> > is the only developer event you need to attend this year. Jumpstart
>>> your
>>> > developing skills, take BlackBerry mobile applications to market and
>>> stay
>>> > ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> > http://p.sf.net/sfu/devconference
>>> > _______________________________________________
>>> > CLucene-developers mailing list
>>> > CLucene-developers@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/clucene-developers
>>> >
>>> >
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>>> is the only developer event you need to attend this year. Jumpstart your
>>> developing skills, take BlackBerry mobile applications to market and stay
>>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>>> http://p.sf.net/sfu/devconference
>>> _______________________________________________
>>> CLucene-developers mailing list
>>> CLucene-developers@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/clucene-developers
>>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> CLucene-developers mailing list
> CLucene-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/clucene-developers
>
>
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to