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
06:57 -0500 : From: Erick Erickson <[EMAIL PROTECTED]> : Reply-To: java-user@lucene.apache.org : To: java-user@lucene.apache.org : Subject: Counting hits in a document : : Hi again. : : I've been struggling for the last couple of days and getting nowhere, so : it's time to swallow my pri

Counting hits in a document

2007-01-18 Thread Erick Erickson
Hi again. I've been struggling for the last couple of days and getting nowhere, so it's time to swallow my pride and say "Help" OK, let's say I have a document indexed and I do NOT have access to the raw text. I need to find the offset of all the hits for a query on a single document. Advice