Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 49513 invoked from network); 9 Feb 2010 15:17:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 15:17:50 -0000 Received: (qmail 45814 invoked by uid 500); 9 Feb 2010 15:17:49 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 45728 invoked by uid 500); 9 Feb 2010 15:17:49 -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 45720 invoked by uid 99); 9 Feb 2010 15:17:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 15:17:49 +0000 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; Tue, 09 Feb 2010 15:17:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 017C5234C1EE for ; Tue, 9 Feb 2010 07:17:28 -0800 (PST) Message-ID: <439485207.150921265728648004.JavaMail.jira@brutus.apache.org> Date: Tue, 9 Feb 2010 15:17:28 +0000 (UTC) From: "Renaud Delbru (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-2154) Need a clean way for Dir/MultiReader to "merge" the AttributeSources of the sub-readers In-Reply-To: <377230757.1260563538136.JavaMail.jira@brutus> 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-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831483#action_12831483 ] Renaud Delbru commented on LUCENE-2154: --------------------------------------- Sorry in advance, maybe what I am saying is out of scope due to my partial understanding of the problem. I have start to look at the problem, in order to be able to use my own attributes from my own DocsAdnPositionsEnum classes. would it not be simpler to create a MultiAttributeSource that is instantiated in the MultiDocsAndPositionsEnum. At creation time, all the AttributeSource of the subreaders (which are available) will be passed in its constructor. This MultiAttributeSource will delegate the getAttribute call to the right DocsAndPositionsEnum$AttributeSource. There is not a single AttributeSource shared by all the subreader, but each subreader keeps its own AttributeSource. In this way, attributes are not overridden. The MultiAttributeSource is in fact like a Wrapper. One problem is when there is custom attributes, e.g. BoostAttribute. If I understand correctly, if the user tries to access the BoostAttribute, but one of the subreader does not know it, the IllegalArgumentException will be thrown. Under the hood, the MultiAttributeSource can check if the attribute exists on the current subreader, and if not it can rely on a default attribute, or a previously stored attribute (coming from a previous subreader). I am not sure if what I am saying is making some sense. It looks to me too simple to cover all the cases. Are there cases I am not aware of ? Could you give me some examples to make me aware of other problems ? > Need a clean way for Dir/MultiReader to "merge" the AttributeSources of the sub-readers > --------------------------------------------------------------------------------------- > > Key: LUCENE-2154 > URL: https://issues.apache.org/jira/browse/LUCENE-2154 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Affects Versions: Flex Branch > Reporter: Michael McCandless > Fix For: Flex Branch > > > The flex API allows extensibility at the Fields/Terms/Docs/PositionsEnum levels, for a codec to set custom attrs. > But, it's currently broken for Dir/MultiReader, which must somehow share attrs across all the sub-readers. Somehow we must make a single attr source, and tell each sub-reader's enum to use that instead of creating its own. Hopefully Uwe can work some magic here :) -- 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