From lucene-net-dev-return-4425-apmail-lucene-lucene-net-dev-archive=lucene.apache.org@lucene.apache.org Wed Feb 16 19:33:44 2011 Return-Path: Delivered-To: apmail-lucene-lucene-net-dev-archive@www.apache.org Received: (qmail 73153 invoked from network); 16 Feb 2011 19:32:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Feb 2011 19:32:37 -0000 Received: (qmail 85950 invoked by uid 500); 16 Feb 2011 19:32:37 -0000 Delivered-To: apmail-lucene-lucene-net-dev-archive@lucene.apache.org Received: (qmail 85648 invoked by uid 500); 16 Feb 2011 19:32:35 -0000 Mailing-List: contact lucene-net-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucene.apache.org Delivered-To: mailing list lucene-net-dev@lucene.apache.org Received: (qmail 85627 invoked by uid 99); 16 Feb 2011 19:32:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 19:32:34 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of currens.chris@gmail.com designates 209.85.214.48 as permitted sender) Received: from [209.85.214.48] (HELO mail-bw0-f48.google.com) (209.85.214.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Feb 2011 19:32:27 +0000 Received: by bwz8 with SMTP id 8so1898813bwz.35 for ; Wed, 16 Feb 2011 11:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=3PotBC4oIYQStPrpnz63YNRzQjEjCAltQFDRABbSf5U=; b=MMPa+OwJDI0pH6Y7YZ5KpoZUAox5QFW0fufKhGGsXW73RonrojXOs8F2r+ZijDWST1 RA+UqJANjsUKUSaBd578sJdVd5PIIKKx448xgI9/t0yspLlEbxoqEwAn2OywaU5OW21Q 11JXFOHi5CEf5zEaBf04cVCC+YxRYwRVVCbAc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=muv01D3k8YLSfYP1x0C7bTlT1coJDGUBr+d06Sev/flvIUiDeZxUk8sk1Jm9kHpXR5 PeDX46jeWXwE1GGYERYnjtAf3QIC57nZsxaCaxNsAH3J/eESYwSKZaSdPAfTMwC11jRs R5V4ysrn7T2a9ODMxlZ6vJF1fpX8S4rDP372w= MIME-Version: 1.0 Received: by 10.204.58.196 with SMTP id i4mr814749bkh.119.1297884725655; Wed, 16 Feb 2011 11:32:05 -0800 (PST) Received: by 10.204.26.200 with HTTP; Wed, 16 Feb 2011 11:32:05 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Feb 2011 11:32:05 -0800 Message-ID: Subject: Re: how can I get the similarity in fuzzy query From: Christopher Currens To: lucene-net-dev@lucene.apache.org Content-Type: multipart/alternative; boundary=001636c5ac69083ea9049c6b56cb --001636c5ac69083ea9049c6b56cb Content-Type: text/plain; charset=ISO-8859-1 I was going to post the link that Digy posted, which suggests not to determine a match that way. If my understanding is correct, the scores returned for a query are relative to which documents were retrieved by the search, in that if a document is deleted from the index, the scores will change even though the query did not, because the number of returned documents are different. If the only thing you wanted to do was to calculate how a resulting string was to a search string, I suggest the Levenshtein Distance algorithm http://en.wikipedia.org/wiki/Levenshtein_distance...but it doesn't seem like that's quite what you want to accomplish based on your question. Christopher On Wed, Feb 16, 2011 at 10:55 AM, Wen Gao wrote: > Hi, > I am using FuzzyQuery to get fuzzy mathed results. I want to get the > similarity in percent for every matched record. > for example, if i search for "databasd", and it will return results such as > "database", "database1", and "database11". I want to get the similarity in > percent for evey record, such as 87.5%, 75%, and 62.5%. > > How can I do this? > > Any ideas? > > Wen Gao > --001636c5ac69083ea9049c6b56cb--