Return-Path: Delivered-To: apmail-incubator-lucy-dev-archive@www.apache.org Received: (qmail 11775 invoked from network); 26 Oct 2010 00:19:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Oct 2010 00:19:44 -0000 Received: (qmail 79285 invoked by uid 500); 26 Oct 2010 00:19:44 -0000 Delivered-To: apmail-incubator-lucy-dev-archive@incubator.apache.org Received: (qmail 79257 invoked by uid 500); 26 Oct 2010 00:19:43 -0000 Mailing-List: contact lucy-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@incubator.apache.org Delivered-To: mailing list lucy-dev@incubator.apache.org Received: (qmail 79249 invoked by uid 99); 26 Oct 2010 00:19:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 00:19:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.116.39.62] (HELO rectangular.com) (68.116.39.62) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 00:19:37 +0000 Received: from marvin by rectangular.com with local (Exim 4.63) (envelope-from ) id 1PAXFz-0007gf-RU for lucy-dev@incubator.apache.org; Mon, 25 Oct 2010 17:19:15 -0700 Date: Mon, 25 Oct 2010 17:19:15 -0700 To: lucy-dev@incubator.apache.org Message-ID: <20101026001915.GA29512@rectangular.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) From: Marvin Humphrey Subject: [lucy-dev] Miscellaneous API changes (Searcher, HeatMap, etc) Greets, I expect to commit a few changes to the public API in a bit, and wanted to document the rationales and open an opportunity for discussion. First, there are four methods and one constructor which should have been officially exposed a while ago; we'll correct the oversight and make them public. TermQuery_Get_Term() TermQuery_Get_Field() Doc_Set_Doc_ID() Doc_Get_Doc_ID() Arch_new() Second, Searcher_Fetch_Doc() will be changed to return a HitDoc rather than an Obj. I'm also going to remove the "score" and "offset" parameters, leaving only "doc_id". Since this brings the argument count down to one, the Perl bindings will now use a single positional arg instead of labeled params. # Before: my $doc = $searcher->fetch_doc( doc_id => $doc_id ); # After: my $doc = $searcher->fetch_doc($doc_id); Similarly, DocReader_Fetch(), which takes three params and returns an Obj, will be replaced by DocReader_Fetch_Doc(), which takes only a doc_id and returns a HitDoc. These Fetch_Doc() changes close the book on an unsuccessful experiment: allowing the Fetch_Doc() stack to return arbitrary objects. It was this ill-advised flexibility which necessitated the addition of parameters to Fetch_Doc(); we'll be returning to the Lucene model for fetching documents, which is simpler for doing simple things, yet still makes hard things possible: # Before ($doc can be an arbitrary object): my $doc = $searcher->fetch_doc( doc_id => $doc_id, offset => $offset, score => $score, ); # After ($doc isa HitDoc): my $doc = $searcher->fetch_doc($doc_id - $offset); $doc->set_doc_id($doc_id); $doc->set_score($score); Lastly, I'm going to redact HeatMap (used by Highlighter) as a public class. It's not complete or polished enough to do what it sets out to do right now. We need to think its interface through a little more. Marvin Humphrey