Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE4F2173B9 for ; Thu, 9 Oct 2014 00:01:26 +0000 (UTC) Received: (qmail 5968 invoked by uid 500); 9 Oct 2014 00:01:21 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 5885 invoked by uid 500); 9 Oct 2014 00:01:21 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 5873 invoked by uid 99); 9 Oct 2014 00:01:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 00:01:21 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.218.43] (HELO mail-oi0-f43.google.com) (209.85.218.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 00:00:54 +0000 Received: by mail-oi0-f43.google.com with SMTP id u20so346132oif.16 for ; Wed, 08 Oct 2014 17:00:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=7xja3zEVbxpfLUWIgO/WxTrAS0uMdGpAn+m2g2vjGTs=; b=AlZ8VNN8VYZ2pinbAGACPjmNS0FfLjy0+qqeTL58S0dScl0CHD3XVeVAiK6HsD1KYC U6z3T2Ln+VLEzyUKTwwRP3bWlzK45vXJH63Hjy/G3sB+i4lLgfpnOxzdcQzXCdo0jWiY juAvQwF6yOis5WzwLboAGii2MhuAJTAriKgGAnUgZWleYnwqZgmLN1Rg2xv7PICVYfOv oQLcrtiNxHywHWCrqf+qxCZR6gdifl07BOCIYTbpkgiVcXeIKtWnTOHT9GIKcxeV0PTb pJdcm6DDSx1V3JYH2EN8PTUPlG3RCAZ/6cqbD8zAOOp9BqwR/B82mjJp8J8EMIgTbtY1 5l3Q== X-Gm-Message-State: ALoCoQkC2LAxlpSsIWe0xDsmhEEsEUW2cbTG8arWWhKWU3+0JyZ+1V1gnhoG5psQHQI8SRNTAGjr X-Received: by 10.60.179.200 with SMTP id di8mr16115998oec.75.1412812852632; Wed, 08 Oct 2014 17:00:52 -0700 (PDT) Received: from frisbee.local (c-68-63-180-159.hsd1.az.comcast.net. [68.63.180.159]) by mx.google.com with ESMTPSA id d6sm1270701obq.4.2014.10.08.17.00.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Oct 2014 17:00:52 -0700 (PDT) Date: Wed, 8 Oct 2014 17:00:45 -0700 (MST) From: Chris Hostetter To: solr-user@lucene.apache.org Subject: Re: Add multiple JSON documents with boost In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-784369152-1412812851=:16255" X-Virus-Checked: Checked by ClamAV on apache.org --8323329-784369152-1412812851=:16255 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT : i try to add documents to the index and boost them (hole document) but i : get this error message: : : ERROR org.apache.solr.core.SolrCore – : org.apache.solr.common.SolrException: Error parsing JSON field value. : Unexpected OBJECT_START : : Any ideas? The top level structure you are sending is a JSON array (because you start with "[") which is how you tell solr you want to send a simple list of documents to add. In order to send explicit commands (like "add") your top level JSON structure needs to be JSON Object (aka: Map), which contains "add" as a key. there are examples of this in the ref guide... https://cwiki.apache.org/confluence/display/solr/Uploading+Data+with+Index+Handlers#UploadingDatawithIndexHandlers-SendingArbitraryJSONUpdateCommands so basically, just take your list containing 2 objects that each have 1 key of "add" and replace it with a single obejct that has 2 "add" keys... : { : "add": { : "boost": 1, : "doc": { : "store_id": 1, : "created_at": "2007-08-23T01:03:05Z", : "sku": {"boost": 10, "value": "n2610"}, : "status": "1", : "tax_class_id_t": "2", : "color_t": "Black", : "visibility": "4", : "name": {"boost": -60, "value": "Nokia 2610 Phone"}, : "url_key": "nokia-2610-phone", : "image": "\/n\/o\/nokia-2610-phone-2.jpg", : "small_image": "\/n\/o\/nokia-2610-phone-2.jpg", : "thumbnail": "\/n\/o\/nokia-2610-phone-2.jpg", : "msrp_enabled_t": "2", : "msrp_display_actual_price_type_t": "4", : "model_t": "2610", : "dimension_t": "4.1 x 1.7 x 0.7 inches", : "meta_keyword_t": "Nokia 2610, cell, phone,", : "short_description": "The words \"entry level\" no longer : mean \"low-end,\" especially when it comes to the Nokia 2610. Offering : advanced media and calling features without breaking the bank", : "price": "149.99", : "in_stock": "1", : "id": "16_1", : "product_id": "16", : "content_type": "product", : "attribute_set_id": "38", : "type_id": "simple", : "has_options": "0", : "required_options": "0", : "entity_type_id": "10", : "category": [ : 8, : 13 : ] : } : } , : "add": { : "boost": 1, : "doc": { : "store_id": 1, : "created_at": "2007-08-23T03:40:26Z", : "sku": {"boost": 10, "value": "bb8100"}, : "color_t": "Silver", : "status": "1", : "tax_class_id_t": "2", : "visibility": "4", : "name": {"boost": -60, "value": "BlackBerry 8100 Pearl"}, : "url_key": "blackberry-8100-pearl", : "thumbnail": "\/b\/l\/blackberry-8100-pearl-2.jpg", : "small_image": "\/b\/l\/blackberry-8100-pearl-2.jpg", : "image": "\/b\/l\/blackberry-8100-pearl-2.jpg", : "model_t": "8100", : "dimension_t": "4.2 x 2 x 0.6 inches", : "meta_keyword_t": "Blackberry, 8100, pearl, cell, phone", : "short_description": "The BlackBerry 8100 Pearl is a : departure from the form factor of previous BlackBerry devices. This : BlackBerry handset is far more phone-like, and RIM's engineers have managed : to fit a QWERTY keyboard onto the handset's slim frame.", : "price": "349.99", : "in_stock": "1", : "id": "17_1", : "product_id": "17", : "content_type": "product", : "attribute_set_id": "38", : "type_id": "simple", : "has_options": "0", : "required_options": "0", : "entity_type_id": "10", : "category": [ : 8, : 13 : ] : } : } : } -Hoss http://www.lucidworks.com/ --8323329-784369152-1412812851=:16255--