Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FC67C61C for ; Wed, 16 May 2012 20:21:07 +0000 (UTC) Received: (qmail 60676 invoked by uid 500); 16 May 2012 20:21:05 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 60605 invoked by uid 500); 16 May 2012 20:21:05 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 60592 invoked by uid 99); 16 May 2012 20:21:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 20:21:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mkimber@kana.com designates 64.95.72.244 as permitted sender) Received: from [64.95.72.244] (HELO mxout.myoutlookonline.com) (64.95.72.244) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2012 20:21:00 +0000 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id ED25C416F9F for ; Wed, 16 May 2012 16:20:38 -0400 (EDT) X-Virus-Scanned: by SpamTitan at mail.lan Received: from HUB015.mail.lan (unknown [10.110.2.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 1636C41700B for ; Wed, 16 May 2012 16:20:15 -0400 (EDT) Received: from BE259.mail.lan ([10.110.32.159]) by HUB015.mail.lan ([10.110.17.15]) with mapi; Wed, 16 May 2012 16:20:14 -0400 From: Mike Kimber To: "user@couchdb.apache.org" Date: Wed, 16 May 2012 16:20:12 -0400 Subject: Couch-lucene - Index all - JSON.parse: expected ',' or '}' after property value in object Thread-Topic: Couch-lucene - Index all - JSON.parse: expected ',' or '}' after property value in object Thread-Index: Ac0zoUwiVneZQ1wVSdO6sE9uGmy0rw== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_A7D50E04F38FD44D9D914F2ABCA592BF2E6E5086BABE259maillan_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_A7D50E04F38FD44D9D914F2ABCA592BF2E6E5086BABE259maillan_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ive built/installed couch-lucene and pointed it at my couchdb database (1.2= ). It works when I index a a individual attribute/key pair, but when I try = an use the index all js code on https://github.com/rnewson/couchdb-lucene v= ia futon I get JSON.parse: expected ',' or '}' after property value in object JSON.parse: expected ',' or '}' after property value in object Ive tried formatting it etc and it all looks fine, but the error message st= ates that the JSON is not valid. My design document looks like: { "_id": "_design/lucene", "_rev": "18-22fdad425fb9f8cd1d8e39ba4b871103", "language": "javascript", "fulltext": { "all": { "index": "function(doc) {var ret =3D new Document(); function id= x(obj) {for (var key in obj) {switch (typeof obj[key]) {case 'object': idx(= obj[key]); break; case 'function': break; default: ret.add(obj[key]); break= ;}}}; idx(doc); if (doc._attachments) {for (var i in doc._attachments) {ret= .attachment("attachment", i); }}return ret; }" } } } The following works, so this suggest to me that it's the javascript that is= the issue Source { "_id": "_design/lucene", "_rev": "19-1c7be47e52f8a65e9bb387e8c3251dd4", "language": "javascript", "fulltext": { "by_type": { "index": "function(doc) { var res =3D new Document(); res.add( d= oc.header.started); return res; }" } } } Any help would be greatly as would be any tips on how to debug this sort of= thing in the future. Thanks Mike --_000_A7D50E04F38FD44D9D914F2ABCA592BF2E6E5086BABE259maillan_--