Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 31891 invoked from network); 6 Feb 2010 13:27:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Feb 2010 13:27:57 -0000 Received: (qmail 92849 invoked by uid 500); 6 Feb 2010 13:27:54 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 92305 invoked by uid 500); 6 Feb 2010 13:27:53 -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 92141 invoked by uid 99); 6 Feb 2010 13:27:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Feb 2010 13:27:53 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of iamrohitbanga@gmail.com designates 209.85.223.198 as permitted sender) Received: from [209.85.223.198] (HELO mail-iw0-f198.google.com) (209.85.223.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Feb 2010 13:27:46 +0000 Received: by iwn36 with SMTP id 36so35225iwn.3 for ; Sat, 06 Feb 2010 05:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=VAcScHMoFmwADtrYdT1pjnN3NGecBgohSYXP5cjRCSQ=; b=XYVtXPxQjSjHyYBEHl6SJqlb7pY5NMm4wW5yFrT844og0gZyEtfR3vb2rPB0hKUN4g HE/+PwF0R4zXgXKyEv/du811jOfzpukAch76fVx3+0jVrtW8MrUKeRKioKFH8nV+d+tC D4PlIxYf4CIAp6jddit6Yz7VYIGX01aHfMRvo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=VtrCKfk2tDOgm+zVBm9EiCRh9HkFbkuGtxZbU+VtN0meLvZ9BiASjq3WBpDDBUnXsp 3Cxo1UJTb5KAeXDeEhfCd+FxQ1WCFtwIXAz/fh+WzFChpokpCB3XE495KH5Mg+e+Q+Zp Eq3NItE18Ijus4euQSOuzkA5h/qVwCjYAwBbw= MIME-Version: 1.0 Received: by 10.231.147.149 with SMTP id l21mr1290088ibv.0.1265462846117; Sat, 06 Feb 2010 05:27:26 -0800 (PST) From: Rohit Banga Date: Sat, 6 Feb 2010 18:57:06 +0530 Message-ID: Subject: hit highlighting in lucene To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016e64eeb586b5ab4047eee878f --0016e64eeb586b5ab4047eee878f Content-Type: text/plain; charset=ISO-8859-1 Hi friends I have just started using lucene and the way i want to use it is the following: i have documents consisting of names of users as one field. i have a sentence that may contain the name of some user. i perform a search for the sentence in the index using the searcher. if it contains the name of the user, then that user's document is listed on top by lucene. now i want to determine the position in the sentence where the string has been found. i am using fuzzy query matching by adding the character '~' to the sentence i am searching. so this means i cannot use the find function of the String class as is to get the position of the match. Thanks in advance -- Rohit Banga --0016e64eeb586b5ab4047eee878f--