going from Document -> IndexReader's docid

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

going from Document -> IndexReader's docid

tlittell

If I have a Document object (doc), and I also have an IndexReader open,
how can I find out IndexReader's docid corresponding to (doc)?

IndexReader has a map from docid -> Document, but I don't see the reverse.

thanks in advance,
Todd


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: going from Document -> IndexReader's docid

Yonik Seeley
There really isn't a generic way... you have to search for the document.
If you have a unique id field in your document, you can find the
document id quickly via IndexReader.termDocs(term)

-Yonik
Now hiring -- http://forms.cnet.com/slink?231706

On 11/9/05, [hidden email] <[hidden email]> wrote:
>
> If I have a Document object (doc), and I also have an IndexReader open,
> how can I find out IndexReader's docid corresponding to (doc)?
>
> IndexReader has a map from docid -> Document, but I don't see the reverse.
>
> thanks in advance,
> Todd

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: going from Document -> IndexReader's docid

Erik Hatcher
The question is, how did you get that Document?   If you got it from  
Hits, you can get the document id from Hits.id(hit_num).

     Erik



On 9 Nov 2005, at 11:13, Yonik Seeley wrote:

> There really isn't a generic way... you have to search for the  
> document.
> If you have a unique id field in your document, you can find the
> document id quickly via IndexReader.termDocs(term)
>
> -Yonik
> Now hiring -- http://forms.cnet.com/slink?231706
>
> On 11/9/05, [hidden email] <[hidden email]> wrote:
>
>>
>> If I have a Document object (doc), and I also have an IndexReader  
>> open,
>> how can I find out IndexReader's docid corresponding to (doc)?
>>
>> IndexReader has a map from docid -> Document, but I don't see the  
>> reverse.
>>
>> thanks in advance,
>> Todd
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: going from Document -> IndexReader's docid

tlittell

Ahh, thank you very much.  That's exactly what I needed, I just didn't see
that in the API.

cheers,
Todd

> The question is, how did you get that Document?   If you got it from
> Hits, you can get the document id from Hits.id(hit_num).
>
>      Erik
>
>
>
> On 9 Nov 2005, at 11:13, Yonik Seeley wrote:
>
>> There really isn't a generic way... you have to search for the
>> document.
>> If you have a unique id field in your document, you can find the
>> document id quickly via IndexReader.termDocs(term)
>>
>> -Yonik
>> Now hiring -- http://forms.cnet.com/slink?231706
>>
>> On 11/9/05, [hidden email] <[hidden email]> wrote:
>>
>>>
>>> If I have a Document object (doc), and I also have an IndexReader
>>> open,
>>> how can I find out IndexReader's docid corresponding to (doc)?
>>>
>>> IndexReader has a map from docid -> Document, but I don't see the
>>> reverse.
>>>
>>> thanks in advance,
>>> Todd
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Encountered "<EOF>" using queryparser in XSP

pgwillia
Hi All,

   I'm using an html form to send a query to an xsp which uses lucene to
search and then returns the results as xml.  Perhaps some one has
experienced the problem that I'm currently experiencing.  When the query
is parsed org.apache.lucene.queryParser.ParseException is thrown stating
that "Encountered "<EOF>" at ..."

  The same query string not sent via a form works in a JUnit test so it
seems to me to be some sort of hidden escape character introduced by
the form or the use of request.getParameterValues('query') in the xsp
which is not accounted for.

  Any advice would be much appreciated.

Cheers,
Tricia

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]