Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 91471 invoked from network); 19 Mar 2009 11:52:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2009 11:52:14 -0000 Received: (qmail 7045 invoked by uid 500); 19 Mar 2009 11:52:13 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 6353 invoked by uid 500); 19 Mar 2009 11:52:11 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 6339 invoked by uid 99); 19 Mar 2009 11:52:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 04:52:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 11:52:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7E5E3234C003 for ; Thu, 19 Mar 2009 04:51:50 -0700 (PDT) Message-ID: <841420233.1237463510501.JavaMail.jira@brutus> Date: Thu, 19 Mar 2009 04:51:50 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1543) Field specified norms in MatchAllDocumentsScorer In-Reply-To: <641555015.1235060761981.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683440#action_12683440 ] Michael McCandless commented on LUCENE-1543: -------------------------------------------- bq. This is how I reason: if the feature of norms scoring is available in all other low level queries, than it also makes sense to have it in the low level MatchAllDocumentsQuery OK I agree. Since the index would already have norms for the field, it makes sense to provide a way to tap solely those norms as the basis for scoring. > Field specified norms in MatchAllDocumentsScorer > ------------------------------------------------- > > Key: LUCENE-1543 > URL: https://issues.apache.org/jira/browse/LUCENE-1543 > Project: Lucene - Java > Issue Type: Improvement > Components: Query/Scoring > Affects Versions: 2.4 > Reporter: Karl Wettin > Priority: Minor > Fix For: 2.9 > > Attachments: LUCENE-1543.txt > > > This patch allows for optionally setting a field to use for norms factoring when scoring a MatchingAllDocumentsQuery. > From the test case: > {code:java} > . > RAMDirectory dir = new RAMDirectory(); > IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); > iw.setMaxBufferedDocs(2); // force multi-segment > addDoc("one", iw, 1f); > addDoc("two", iw, 20f); > addDoc("three four", iw, 300f); > iw.close(); > IndexReader ir = IndexReader.open(dir); > IndexSearcher is = new IndexSearcher(ir); > ScoreDoc[] hits; > // assert with norms scoring turned off > hits = is.search(new MatchAllDocsQuery(), null, 1000).scoreDocs; > assertEquals(3, hits.length); > assertEquals("one", ir.document(hits[0].doc).get("key")); > assertEquals("two", ir.document(hits[1].doc).get("key")); > assertEquals("three four", ir.document(hits[2].doc).get("key")); > // assert with norms scoring turned on > MatchAllDocsQuery normsQuery = new MatchAllDocsQuery("key"); > assertEquals(3, hits.length); > // is.explain(normsQuery, hits[0].doc); > hits = is.search(normsQuery, null, 1000).scoreDocs; > assertEquals("three four", ir.document(hits[0].doc).get("key")); > assertEquals("two", ir.document(hits[1].doc).get("key")); > assertEquals("one", ir.document(hits[2].doc).get("key")); > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org