Re: Counting hits in a document

2007-01-19 Thread Paul Elschot
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 betwee

Re: Counting hits in a document

2007-01-18 Thread Chris Hostetter
: It was late this afternooon and I was square-eyed, so I didn't add the : detail. The app we're working on first returns a summary list of all the : books that match a query, no hit information. Next, the user clicks on a : returned title and we show the hits by chapter. That is, a list of chapte

Re: Counting hits in a document

2007-01-18 Thread Mark Miller
Mark: Very most excellent. I'll give it a look in the morning. I hope that the class doesn't need the raw text since I don't have it any more, but your comment "Give it a query it will give you the spans" makes me hopeful. Should have been more specific: Just give it a query and an appropriat

Re: Counting hits in a document

2007-01-18 Thread Erick Erickson
Hoss: It was late this afternooon and I was square-eyed, so I didn't add the detail. The app we're working on first returns a summary list of all the books that match a query, no hit information. Next, the user clicks on a returned title and we show the hits by chapter. That is, a list of chapter

Re: Counting hits in a document

2007-01-18 Thread Mark Miller
Just threw together a highlighter that can handle spans (combining a rewrite with dumspans from LIA) and used this: http://issues.apache.org/bugzilla/attachment.cgi?id=15568 Nice spans extractor from Mark (not me ). Give it a query it will give you the spans. - Mark Erick Erickson wrote: H

Re: Counting hits in a document

2007-01-18 Thread Chris Hostetter
The Spans interface has a skipTo for jumping to a specific documentId (or the first matching document with a higher documentId) once you've done that, then the doc(), start(), and end() calls will tell you info about the match (which doc it's in, where that match starts, nd where it ends) ... use