Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 73340 invoked from network); 10 Feb 2011 01:25:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2011 01:25:20 -0000 Received: (qmail 57154 invoked by uid 500); 10 Feb 2011 01:25:19 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 57107 invoked by uid 500); 10 Feb 2011 01:25:18 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 57100 invoked by uid 99); 10 Feb 2011 01:25:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 01:25:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Feb 2011 01:25:17 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C9D6819C231 for ; Thu, 10 Feb 2011 01:24:57 +0000 (UTC) Date: Thu, 10 Feb 2011 01:24:57 +0000 (UTC) From: "Fernando Wasylyszyn (JIRA)" To: dev@lucene.apache.org Message-ID: <511466947.6889.1297301097797.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (LUCENE-1608) CustomScoreQuery should support arbitrary Queries 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/LUCENE-1608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fernando Wasylyszyn updated LUCENE-1608: ---------------------------------------- Attachment: CustomScoreQueryWithSubqueries.java I upload a class (for demonstration purposes only, is not clean enough for a patch, that is why is not a patch) that allows secondary queries to be any type of query, not only ValueSourceQuery. For example, the main query could be (field1:value OR field2:value) and one secondary query (field3:anotherValue). There are more optimizations to be done on this class: continuing the previous example, if the secondary query would be (field1:value), then some type of "scorer cache" would be useful in order to avoid keeping two scorers for the same query (first clause in main query and secondary query). Comments are more than welcome. > CustomScoreQuery should support arbitrary Queries > ------------------------------------------------- > > Key: LUCENE-1608 > URL: https://issues.apache.org/jira/browse/LUCENE-1608 > Project: Lucene - Java > Issue Type: New Feature > Components: Query/Scoring > Reporter: Steven Bethard > Assignee: Doron Cohen > Priority: Minor > Attachments: CustomScoreQueryWithSubqueries.java, LUCENE-1608.patch > > > CustomScoreQuery only allows the secondary queries to be of type ValueSourceQuery instead of allowing them to be any type of Query. As a result, what you can do with CustomScoreQuery is pretty limited. > It would be nice to extend CustomScoreQuery to allow arbitrary Query objects. Most of the code should stay about the same, though a little more care would need to be taken in CustomScorer.score() to use 0.0 when the sub-scorer does not produce a score for the current document. -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org