Hi,
You should get the `Hits' from `IndexSearcher.search(...)'
You could refer to the example code in the Lucene source package, or have a
look at the book `Lucene in Action'
2008/2/23, sumittyagi <[EMAIL PROTECTED]>:
>
>
> here is my code, i am just starting, so having little bit of trouble in
It should be hits.id(i), not hits.id[i]. Note id is a method not an
array.
-Original Message-
From: sumittyagi [mailto:[EMAIL PROTECTED]
Sent: Friday, February 22, 2008 4:06 PM
To: java-user@lucene.apache.org
Subject: Re: How to get the doc ID from HITS
here is my code, i am just
here is my code, i am just starting, so having little bit of trouble in
starting, i am just trying to access some values and then want to print it
to get started..
here is my code
package db;
import java.io.*;
import java.util.*;
import java.lang.*;
import org.apache.lucene.search.Hits;
import o
thanks for replying
it may be a silly question but what do in the code
Hits hits = ...
int hitCount = hits.length();
for (int i=0;i
> Two ways to work through the Hits object getting docids are:
>
> Hits hits = ...
> int hitCount = hits.length();
> for (int i=0;iint docId = hits.id[i] ;
>
Two ways to work through the Hits object getting docids are:
Hits hits = ...
int hitCount = hits.length();
for (int i=0;ihttp://lucene.apache.org/java/2_3_0/api/org/apache/lucene/search/Hits.html
as this is just code typed into a mail program!
Regards,
Kent
On Fri, Feb 22, 2008 at 4:17 PM, sumi
You should call Hits.id(n) for getting the docId of the nth document.
On Fri, Feb 22, 2008 at 10:47 AM, sumittyagi <[EMAIL PROTECTED]> wrote:
>
> hi, is there any way to retrieve the doc ids from HITS, Please advise me
> regarding this , i am new to lucene and programming.
> --
> View this mess