Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 49470 invoked from network); 20 Jul 2008 11:54:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jul 2008 11:54:52 -0000 Received: (qmail 13068 invoked by uid 500); 20 Jul 2008 11:54:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 13031 invoked by uid 500); 20 Jul 2008 11:54:46 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 13020 invoked by uid 99); 20 Jul 2008 11:54:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jul 2008 04:54:46 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jul 2008 11:53:49 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KKXTY-0004dg-4x for java-user@lucene.apache.org; Sun, 20 Jul 2008 04:53:16 -0700 Message-ID: <18553514.post@talk.nabble.com> Date: Sun, 20 Jul 2008 04:53:16 -0700 (PDT) From: starz10de To: java-user@lucene.apache.org Subject: Re: Return the sentence number in the indexed files In-Reply-To: <910A445A-0C7A-4263-9419-C4F75E92EF0A@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: farag_ahmed@yahoo.com References: <18543061.post@talk.nabble.com> <910A445A-0C7A-4263-9419-C4F75E92EF0A@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org thanks Grant for the answer, to index each sentence as a separate document , i already did this and it work fine, i indexed more than 93000 sentences (Documents) approx. in 11 minutes. I though the other option might be more efficient. Farag Grant Ingersoll-6 wrote: > > > On Jul 19, 2008, at 6:00 AM, starz10de wrote: > >> >> Hi All, >> >> I have a text files that contain several sentences, there is space >> between >> each sentence. >> When searching the index , i get the path for the documents that >> match the >> query >> >> String path = doc.get("path"); >> >> >> Is it possible to get the number of the sentence that match the query >> inside the matched documents? > > Not without some extra work. This kind of thing requires post (or > pre) processing. You can use SpanQuery to know where in a document > you matched, and then do the sentence calculations. Another option is > to index each sentence as a separate document and then post process to > combine. > > If you search the archives on this list and java-dev you'll see > several discussions on the topic. See: > http://lucene.markmail.org/message/we25gm32p6qot32c?q=sentence+detection > and > http://lucene.markmail.org/message/uq6ffx3oqsulgxys?q=sentence > > HTH, > Grant > > > -------------------------- > Grant Ingersoll > http://www.lucidimagination.com > > Lucene Helpful Hints: > http://wiki.apache.org/lucene-java/BasicsOfPerformance > http://wiki.apache.org/lucene-java/LuceneFAQ > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > -- View this message in context: http://www.nabble.com/Return-the-sentence-number-in-the-indexed-files-tp18543061p18553514.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org