Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 61081 invoked from network); 24 Nov 2009 14:56:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Nov 2009 14:56:48 -0000 Received: (qmail 11405 invoked by uid 500); 24 Nov 2009 14:56:46 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 11311 invoked by uid 500); 24 Nov 2009 14:56:46 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 11301 invoked by uid 99); 24 Nov 2009 14:56:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 14:56:46 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ctignor@thinkmap.com designates 74.125.92.25 as permitted sender) Received: from [74.125.92.25] (HELO qw-out-2122.google.com) (74.125.92.25) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 14:56:40 +0000 Received: by qw-out-2122.google.com with SMTP id 9so787243qwb.53 for ; Tue, 24 Nov 2009 06:56:19 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.14.93 with SMTP id f29mr146107qca.90.1259074579437; Tue, 24 Nov 2009 06:56:19 -0800 (PST) Date: Tue, 24 Nov 2009 09:56:19 -0500 Message-ID: <6f287d1b0911240656p3370d74ej66de1374e353dff2@mail.gmail.com> Subject: customized SpanQuery Payload usage From: Christopher Tignor To: java-user Content-Type: multipart/alternative; boundary=0015175767bc0d97b604791f252b --0015175767bc0d97b604791f252b Content-Type: text/plain; charset=ISO-8859-1 Hello, For certain span queries I construct problematically by piecing together my own SpanTermQueries I would like to enforce that Payload data is not returned for matches on those specific terms used by the constituent SapnTermQueries. For exmaple if I search for a position match with a SpanQuery referencing the tokens "_n" and "work" and there is Payload data for each (there needs to be for other types of queries) I would like to be able to screen out the payload data originating from any matched "_n" tokens. I thought for the tokens I am not interested in receiving payload data from I might simply create (anonymously) my own subclass of SpanTermQuery which overrides getSpans and returns another custom class which extends TermSpans but there simply overrides isPayloadAvailable to return false: new SpanTermQuery(new Term(myField, myTokenString)) { public Spans getSpans(IndexReader reader) throws IOException { return new TermSpans(reader.termPositions(term), term) { public boolean isPayloadAvailable() { return false; } }; } }); This however seems to eliminating payload data for all matches though I'm not sure why and am tracing through the code, looking at NearSpansUnordered. Any thoughts? thanks so much, C>T> -- TH!NKMAP Christopher Tignor | Senior Software Architect 155 Spring Street NY, NY 10012 p.212-285-8600 x385 f.212-285-8999 --0015175767bc0d97b604791f252b--