Return-Path: X-Original-To: apmail-lucenenet-dev-archive@www.apache.org Delivered-To: apmail-lucenenet-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6F8ED272 for ; Fri, 16 Nov 2012 10:00:16 +0000 (UTC) Received: (qmail 17944 invoked by uid 500); 16 Nov 2012 10:00:16 -0000 Delivered-To: apmail-lucenenet-dev-archive@lucenenet.apache.org Received: (qmail 17186 invoked by uid 500); 16 Nov 2012 10:00:15 -0000 Mailing-List: contact dev-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucenenet.apache.org Delivered-To: mailing list dev@lucenenet.apache.org Received: (qmail 17094 invoked by uid 99); 16 Nov 2012 10:00:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Nov 2012 10:00:14 +0000 Date: Fri, 16 Nov 2012 10:00:14 +0000 (UTC) From: "Hadrien HUGOT (JIRA)" To: dev@lucenenet.apache.org Message-ID: <1927571457.123085.1353060014250.JavaMail.jiratomcat@arcas> In-Reply-To: <1661170653.123039.1353057492110.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (LUCENENET-513) GetFieldQuery in MultiFieldQueryParser not handle properly Boosts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENENET-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hadrien HUGOT updated LUCENENET-513: ------------------------------------ Attachment: LUCENENET-513-Fix.patch Patch fixing the issue > GetFieldQuery in MultiFieldQueryParser not handle properly Boosts > ----------------------------------------------------------------- > > Key: LUCENENET-513 > URL: https://issues.apache.org/jira/browse/LUCENENET-513 > Project: Lucene.Net > Issue Type: Bug > Components: Lucene.Net Core > Affects Versions: Lucene.Net 3.0.3 > Reporter: Hadrien HUGOT > Attachments: LUCENENET-513-Fix.patch > > > Regression between Lucene 2.9.4g and Lucene 3.0.3 in the method GetFieldQuery of MultiFieldQueryParser with the boosts factor. > {noformat} > public class MultiFieldQueryParser : QueryParser { > protected internal override Query GetFieldQuery(string field, string queryText, int slop) > { > ... > //If the user passes a map of boosts > if (boosts != null) > { > //Get the boost from the map and apply them > Single boost = boosts[fields[i]]; > q.Boost = boost; > } > ... > {noformat} > If all fields don't have a boost factor an exception is throw by "Single boost = boosts[fields[i]];" > In version 2.9.4g, a check was performed, and no boost were apply if the field is not boosted. > I added a patch with the following modification: > {noformat} > //Get the boost and apply them if exists > float boost; > if (boosts.TryGetValue(fields[i], out boost)) > q.Boost = boost; > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira