Adding a few details: On Friday 19 January 2007 06:42, Chris Hostetter wrote: > > > SpanQuery whatever = ... > Spans s = whatever.getSpans(indexReader) if (!s.skipTo(yourDocId)) { ... // no match } else { > while (s.doc() == yourDocId) { > print("match between " + s.start() + " and " + s.end()); if (! s.next()) break; > } }
For performance, make sure not to go the the same disk the index is on while using the spans like this. In case you have multiple docs to treat, skip to them in increasing docId order using the same spans. And if you ever want to write a Scorer, just add more details... Regards, Paul Eschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]