Return-Path: Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: (qmail 63149 invoked from network); 14 Mar 2011 14:37:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Mar 2011 14:37:55 -0000 Received: (qmail 90784 invoked by uid 500); 14 Mar 2011 14:37:52 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 90709 invoked by uid 500); 14 Mar 2011 14:37:52 -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 90667 invoked by uid 99); 14 Mar 2011 14:37:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Mar 2011 14:37:52 +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; Mon, 14 Mar 2011 14:37:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F1CCD3A8CD5 for ; Mon, 14 Mar 2011 14:37:30 +0000 (UTC) Date: Mon, 14 Mar 2011 14:37:30 +0000 (UTC) From: "Simon Willnauer (JIRA)" To: dev@lucene.apache.org Message-ID: <1392514293.760.1300113450987.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Updated: (LUCENE-2450) Explore write-once attr bindings in the analysis chain 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-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Simon Willnauer updated LUCENE-2450: ------------------------------------ Labels: mentor (was: gsoc2011 lucene-gsoc-11) > Explore write-once attr bindings in the analysis chain > ------------------------------------------------------ > > Key: LUCENE-2450 > URL: https://issues.apache.org/jira/browse/LUCENE-2450 > Project: Lucene - Java > Issue Type: Improvement > Components: Analysis > Reporter: Michael McCandless > Labels: mentor > Attachments: LUCENE-2450.patch, LUCENE-2450.patch, pipeline.py > > > I'd like to propose a new means of tracking attrs through the analysis > chain, whereby a given stage in the pipeline cannot overwrite attrs > from stages before it (write once). It can only write to new attrs > (possibly w/ the same name) that future stages can see; it can never > alter the attrs or bindings from the prior stages. > I coded up a prototype chain in python (I'll attach), showing the > equivalent of WhitespaceTokenizer -> StopFilter -> SynonymFilter -> > Indexer. > Each stage "sees" a frozen namespace of attr bindings as its input; > these attrs are all read-only from its standpoint. Then, it writes to > an "output namespace", which is read/write, eg it can add new attrs, > remove attrs from its input, change the values of attrs. If that > stage doesn't alter a given attr it "passes through", unchanged. > This would be an enormous change to how attrs are managed... so this > is very very exploratory at this point. Once we decouple indexer from > analysis, creating such an alternate chain should be possible -- it'd > at least be a good test that we've decoupled enough :) > I think the idea offers some compelling improvements over the "global > read/write namespace" (AttrFactory) approach we have today: > * Injection filters can be more efficient -- they need not > capture/restoreState at all > * No more need for the initial tokenizer to "clear all attrs" -- > each stage becomes responsible for clearing the attrs it "owns" > * You can truly stack stages (vs having to make a custom > AttrFactory) -- eg you could make a Bocu1 stage which can stack > onto any other stage. It'd look up the CharTermAttr, remove it > from its output namespace, and add a BytesRefTermAttr. > * Indexer should be more efficient, in that it doesn't need to > re-get the attrs on each next() -- it gets them up front, and > re-uses them. > Note that in this model, the indexer itself is just another stage in > the pipeline, so you could do some wild things like use 2 indexer > stages (writing to different indexes, or maybe the same index but > somehow with further processing or something). > Also, in this approach, the analysis chain is more informed about the > what each stage is allowed to change, up front after the chain is > created. EG (say) we will know that only 2 stages write to the term > attr, and that only 1 writes posIncr/offset attrs, etc. Not sure > if/how this helps us... but it's more strongly typed than what we have > today. > I think we could use a similar chain for processing a document at the > field level, ie, different stages could add/remove/change different > fields in the doc.... -- 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