lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Galitsky" <>
Subject How to get Document (or filename) from Span
Date Tue, 18 Apr 2006 17:58:47 GMT
Thanks a lot Hoss

The question is when I get Spans, I get start/end positions and a 
Document order (starting from 0), not the Document object itself from 
which I could get a filename. Since I believe there is no way to get a 
Document object from Spans, and there is no such thing as Document ID 
in Lucene (right?) I attempt to have the same order for
Hits and for Spans (the indexing order) and retrieve Document for each 
Spans this way.

I will try to prepare a test case. It works so far but I am afraid it 
will be unstable.

Best regards

On Tue, 18 Apr 2006 10:29:30 -0700 (PDT)
  Chris Hostetter <> wrote:
> : For some reason, there is a disagreement between the order the
> : Documents are returned in hits, and the Documents are referenced 
> : order number, starting from 0) in the Spans?
> When dealing with a Hits instance, documents are iterated over in 
> order" -- which may be by score, or may be by some other sort you've
> specified.
> When dealing with a Spans instance, i believe the matches are 
> over in index order.  Besides the perofrmance reasosn why this may
> be true, you also have to keep in mind that the Spans instance has 
> idea what ordering you may have used when you executed your search 
>-- even
> if it assumed you sorted by score, the SpanQuery may have been a 
>part of a
> much larger more complicated query in which the final scores were 
> different.
> If i've missunderstood your problem, could you plee post a JUnit 
>test case
> that builds a small index in a RAMDIrectory, with some code that
> demonstrates what you expect to happen, and how it fails?
> -Hoss
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message