Return-Path: Delivered-To: apmail-incubator-lucy-dev-archive@www.apache.org Received: (qmail 8748 invoked from network); 6 Dec 2010 23:27:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 23:27:06 -0000 Received: (qmail 3240 invoked by uid 500); 6 Dec 2010 23:27:06 -0000 Delivered-To: apmail-incubator-lucy-dev-archive@incubator.apache.org Received: (qmail 3168 invoked by uid 500); 6 Dec 2010 23:27:06 -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 3160 invoked by uid 99); 6 Dec 2010 23:27:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 23:27:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Mon, 06 Dec 2010 23:26:56 +0000 Received: from marvin by rectangular.com with local (Exim 4.63) (envelope-from ) id 1PPkS1-0003Hm-E8 for lucy-dev@incubator.apache.org; Mon, 06 Dec 2010 15:26:33 -0800 Date: Mon, 6 Dec 2010 15:26:33 -0800 To: lucy-dev@incubator.apache.org Message-ID: <20101206232633.GA12499@rectangular.com> References: <4CFD334A.8070309@peknet.com> <20101206191659.GA11876@rectangular.com> <4CFD36FC.30800@peknet.com> <20101206225432.GB22686@rot13.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101206225432.GB22686@rot13.org> User-Agent: Mutt/1.5.13 (2006-08-11) From: Marvin Humphrey X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [lucy-dev] ElasticSearch On Mon, Dec 06, 2010 at 11:54:32PM +0100, Dobrica Pavlinusic wrote: > Which leads me to practical question: what's current state of schema in > KinoSearch and/or lucy? > > I seems to remember API for adding fields on the fly while indexing in > older version of KinoSearch, but I can't find anything similar in > documentation for 0.31. > > I would love to index CouchDB _changes feed with (much like > ElasticSearch CouchDB river) but I don't really know schema in advance. Dynamic schemas are supported, same as in KS 0.2x. Supplying a document with an unknown field still triggers an exception, so you just have to iterate over all fields in the unknown document and call spec_field() for anything which hasn't been seen before. while (my $doc = get_next_doc_from_somewhere()) { for my $field (keys %$doc) { next if $schema->fetch_type($field); $schema->spec_field(name => $field, type => $type); } $indexer->add_doc($doc); } $indexer->commit; Marvin Humphrey