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 0F9F4181FE for ; Wed, 22 Jul 2015 07:47:47 +0000 (UTC) Received: (qmail 97006 invoked by uid 500); 22 Jul 2015 07:47:39 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 96929 invoked by uid 500); 22 Jul 2015 07:47:39 -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 96917 invoked by uid 99); 22 Jul 2015 07:47:38 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2015 07:47:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 376041A7629 for ; Wed, 22 Jul 2015 07:47:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id nCUQWfCNXQ2o for ; Wed, 22 Jul 2015 07:47:37 +0000 (UTC) Received: from mail-yk0-f178.google.com (mail-yk0-f178.google.com [209.85.160.178]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id AF74D2641F for ; Wed, 22 Jul 2015 07:47:36 +0000 (UTC) Received: by ykdu72 with SMTP id u72so186176542ykd.2 for ; Wed, 22 Jul 2015 00:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=dhmdVPnNRagATUc4LgXxcdBV18HVc5Cs+Y2wV0End5A=; b=N+2b6xZXlQDbeJ8iDfKCLf3p0bAKut7LaW3cXiNdOfv+2PfNSEhF7IbvcRZYR2EsHs /Nvg9qKtBxiYAFZoCTCNVYUglMJ27lbyYcid7aYv5RxSuga0a/ZlKGxgh2lredkV7ERt PykFS4JdcfE4/RD1Jv+UbtV9+P6L+Kxn/K295umbQg8OEMKAdQhPVVPr2cfJk/R/gtIn yPaV9Ayq4EdcPUJaL584OeqhI7G/tK53DnOKiVT6/+XHHvWV5Y7lq+F5Qqnu+WNarhrF oWCgOFTQvYK50gB/IyOBSOBccJSTXjw8FvfqBJ5HajuRrPoxw/pA2IwPBCoeynMFJ/9K aQQQ== X-Received: by 10.170.69.9 with SMTP id l9mr1107992ykl.38.1437551255847; Wed, 22 Jul 2015 00:47:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.146.213 with HTTP; Wed, 22 Jul 2015 00:47:16 -0700 (PDT) From: Vineeth Dasaraju Date: Wed, 22 Jul 2015 00:47:16 -0700 Message-ID: Subject: Custom Response Writer for JSON Objects To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a1139f91cf38797051b71fb05 --001a1139f91cf38797051b71fb05 Content-Type: text/plain; charset=UTF-8 Hi, I have been using json objects of the form shown below to index into solr. As you can see, there are nested JSON objects and JSON arrays. { "RawEventMessage": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dolor orci, placerat ac pretium a, tincidunt consectetur mauris. Etiam sollicitudin sapien id odio tempus, non sodales odio iaculis. Donec fringilla diam at placerat interdum. Proin vitae arcu non augue facilisis auctor id non neque. Integer non nibh sit amet justo facilisis semper a vel ligula. Pellentesque commodo vulputate consequat. ", "EventUid": "1279706565", "TimeOfEvent": "2015-05-01-08-07-13", "TimeOfEventUTC": "2015-05-01-01-07-13", "EventCollector": "kafka", "EventMessageType": "kafka-@column", "User": { "User": "Lorem ipsum", "UserGroup": "Manager", "Location": "consectetur adipiscing", "Department": "Legal" }, "EventDescription": { "EventApplicationName": "", "Query": "SELECT * FROM MOVIES", "Information": [ { "domainName": "English", "columns": [ { "movieName": "Casablanca", "duration": "154", }, { "movieName": "Die Hard", "duration": "127", } ] }, { "domainName": "Hindi", "columns": [ { "movieName": "DDLJ", "duration": "176", } ] } ] } } For indexing this object, I am creating a parent JSON Object that contains all the top level attributes and am creating child objects for all nested JSON objects and linking the two of the. The problem arises that when I query for a top level attribute, I get only 1 document that shows only the top level attributes but does not contain any of the nested json objects. How can I ensure that I get JSON objects similar to the way they are originally indexed into Solr? Is there any custom response writer in Solr that can achieve this functionality? Regards, Vineeth --001a1139f91cf38797051b71fb05--