Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 45F25200D52 for ; Sat, 2 Dec 2017 21:07:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3AE5F160BFB; Sat, 2 Dec 2017 20:07:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 57E84160BEA for ; Sat, 2 Dec 2017 21:07:12 +0100 (CET) Received: (qmail 82216 invoked by uid 500); 2 Dec 2017 20:07:10 -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 82202 invoked by uid 99); 2 Dec 2017 20:07:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Dec 2017 20:07:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 53C481808C9 for ; Sat, 2 Dec 2017 20:07:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.652 X-Spam-Level: X-Spam-Status: No, score=-2.652 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=comcast.net Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id p6EcKznLsSIc for ; Sat, 2 Dec 2017 20:07:07 +0000 (UTC) Received: from resqmta-po-02v.sys.comcast.net (resqmta-po-02v.sys.comcast.net [96.114.154.161]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 2AAAE5F24C for ; Sat, 2 Dec 2017 20:07:07 +0000 (UTC) Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-02v.sys.comcast.net with ESMTP id LE3febJoe0qygLE3veuDxQ; Sat, 02 Dec 2017 20:06:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1512245219; bh=xSq7VORHXX1R/rca/vSlCFMJ4LtioxDEvaU2Hf8pekA=; h=Received:Received:Subject:From:To:Message-ID:Date:MIME-Version: Content-Type; b=QjYcYKZcgvLFNo7VClOF42wkbA0GxKoccRwVfPbXWXdYBzdiuzb7ZAH1tH5//3swN lCD4nP4gXI2WwwUsF+WyaXpYVAPM8CBA2OElKxNfPmRvHjQktelibtdxNPqSaloYS4 k9ONKMEZ1xz6sO098Ue6iJtR7wMfrK/+Dzb0+KTtJYyAu/KwWxHYcjMqp5CBGKbnOk PpJJD43ugL4LguI08s0VRr6ff6CoAoX4hbwkVhtIgPkXOb1Y3YEmDRqm0dfEqeoOla zHhfQtgJIMZ9fODlxGN0EWAdEz77d1CTR9U6BI6J+8PPH3l0xWPtC1k3M9qqYvePG6 Mj0lpm7o/Yukw== Received: from [192.168.1.2] ([73.177.34.199]) by resomta-po-16v.sys.comcast.net with SMTP id LE3veLzqSqSR0LE3veE300; Sat, 02 Dec 2017 20:06:59 +0000 Subject: Re: Having trouble indexing nested docs using "split" feature. From: David Lee To: solr-user@lucene.apache.org References: Message-ID: <04edec9f-9c7d-4d6b-5952-4f9b4e6e4d2b@comcast.net> Date: Sat, 2 Dec 2017 14:06:57 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CMAE-Envelope: MS4wfMK+Bj/tezZcISa4azJZpqGbh8AvJCNC1pyq5NHylId5gqp92s5zk9GjWuYHbXJIiVJNRnGGMBFqfq35jkbwFF/q6ApQ7m8GLtb/Tl+yKum84AeM8yjk jj22CmdnItpC6cCRwLwzGIhDX2axtf/Tf9D/4PVi3ZFta6j4dJsByfQpVAQPrBRU6rgPT0ytM7EuiQ== archived-at: Sat, 02 Dec 2017 20:07:13 -0000 Sorry about the formatting for the first part, hope this is clearer: {     "book_id": "1234",     "book_title": "The Martian Chronicles", "author": "Ray Bradbury", "reviews": [     { "reviewer": "John Smith",             "reviewer_background": { "highest_rank": "Excellent",                 "latest_review": "10/15/2017 10:15:00.000 CST",             }         }, { "reviewer": "Adam Smith",             "reviewer_background": { "highest_rank": "Good",              "latest_review": "10/10/2017 16:18:00.000 CST", } } ], "checkouts": [ { "member_id": "aaabbbccc",  "member_name": "Sam Jackson" },{ "member_id": "bbbcccddd",            "member_name": "Buddy Jones"        }    ] } On 12/2/2017 1:55 PM, David Lee wrote: > Hi all, > > I've been trying for some time now to find a suitable way to deal with > json documents that have nested data. By suitable, I mean being able > to index them and retrieve them so that they are in the same structure > as when indexed. > > I'm using version 7.1 under linux Mint 18.3 with Oracle Java > 1.8.0_151. After untarring the distribution, I ran through the > "getting started" tutorial from the reference manual where it had me > create the techproducts index. I then created another collection > called my_collection so I could run the examples more easily. It used > the _default schema. > > Here is a sample: > > { > >     "book_id": "1234",     "book_title": "The Martian Chronicles",     > "author": "Ray Bradbury", "reviews": [         { "reviewer": "John > Smith",             "reviewer_background": {                 > "highest_rank": "Excellent", "latest_review": "10/15/2017 10:15:00.000 > CST",             }         }, {             "reviewer": "Adam Smith", > "reviewer_background": {             "highest_rank": "Good", >             "latest_review": "10/10/2017 16:18:00.000 CST",         } >     } ], "checkouts": [ { "member_id": "aaabbbccc", "member_name": > "Sam Jackson" },{ "member_id": "bbbcccddd",           "member_name": > "Buddy Jones"       }   ] } > > Obviously, I'll need to search at the parent level and child level. I > started experimenting and tried to use one of the examples from > "Transforming and Indexing Solr JSON". However, when I tried the first > example as follows: > > curl 'http://localhost:8983/solr/my_collection/update/json/docs'\ >> '?split=/exams'\ >> '&f=first:/first'\ >> '&f=last:/last'\ >> '&f=grade:/grade'\ >> '&f=subject:/exams/subject'\ >> '&f=test:/exams/test'\ >> '&f=marks:/exams/marks'\ >>   -H 'Content-type:application/json' -d ' >> { >>    "first": "John", >>    "last": "Doe", >>    "grade": 8, >>    "exams": [ >>      { >>        "subject": "Maths", >>        "test"   : "term1", >>        "marks"  : 90}, >>      { >>        "subject": "Biology", >>        "test"   : "term1", >>        "marks"  : 86} >>    ] >> }' > { >   "responseHeader":{ >     "status":0, >     "QTime":798}} > > Though the status indicates there was no error, when I try to query on > the the data using *:*, I get this: > > curl 'http://localhost:8983/solr/my_collection/select?q=*:*' > { >   "responseHeader":{ >     "zkConnected":true, >     "status":0, >     "QTime":6, >     "params":{ >       "q":"*:*"}}, >   "response":{"numFound":0,"start":0,"maxScore":0.0,"docs":[] >   }} > > So it looks like no documents were actually indexed from above. I'm > trying to determine if this is due to an error in the reference > manual, or if I haven't set up Solr correctly. > > I've tried other techniques (not using the split option) like from > Yonik's site, but those are slightly dated and I was hoping there was > a more practical approach with the release of Solr 7. > > Any assistance would be appreciated. > > Thank you. > > > > >