title: How to Retrieve and Query JSON type fields in Apache Solr 6.5
body: <p>My Goal is to retrieve JSON type fields in an Solr index and also perform search queries on such fields. </p>
  
  <p>I have the following documents in Solr Index and using the auto generated schema utilizing schemaless feature in Solr.</p>
  
  <p>POST <a href="http://localhost:8983/solr/test1/update?commitWithin=1000" rel="nofollow noreferrer">http://localhost:8983/solr/test1/update?commitWithin=1000</a></p>
  
  <pre><code>[
      {"id" : "1", "type_s":"book", "title_t" : "The Way of Kings", "author_s" : "Brandon Sanderson",
  "miscinfo": {"provider": "orielly", "site": "US"}
   },
   {"id" : "2", "type_s":"book", "title_t" : "The Game of Thrones", "author_s" : "James Sanderson",
  "miscinfo": {"provider": "pacman", "site": "US"}
   }
   ]
  </code></pre>
  
  <p>I see the JSON types are stored as strings in the schemaField type as seen in the output for following </p>
  
  <p>GET <a href="http://localhost:8983/solr/test1/schema/fields" rel="nofollow noreferrer">http://localhost:8983/solr/test1/schema/fields</a></p>
  
  <pre><code>{
        "name":"miscinfo",
        "type":"strings"}
  </code></pre>
  
  <p>I had tried using srcField as mentioned in this <a href="https://stackoverflow.com/questions/41566634/how-to-retrieve-json-in-original-nested-form-in-apache-solr">post</a>. However, a query to retrieve json type returns empty response. Below are the GET request used for the same  </p>
  
  <p>GET <a href="http://localhost:8983/solr/test1/select?q=1&amp;fl=miscinfo&amp;wt=json" rel="nofollow noreferrer">http://localhost:8983/solr/test1/select?q=1&amp;fl=miscinfo&amp;wt=json</a></p>
  
  <p>GET <a href="http://localhost:8983/solr/test1/select?q=1&amp;fl=miscinfo,source_s:[json]&amp;wt=json" rel="nofollow noreferrer">http://localhost:8983/solr/test1/select?q=1&amp;fl=miscinfo,source_s:[json]&amp;wt=json</a></p>
  
  <p>Also, the search queries for values inside JSON type fields return empty response</p>
  
  <p><a href="http://localhost:8983/solr/test1/select?q=pacman&amp;wt=json" rel="nofollow noreferrer">http://localhost:8983/solr/test1/select?q=pacman&amp;wt=json</a></p>
  
  <pre><code>{
    "responseHeader": {
      "status": 0,
      "QTime": 0,
      "params": {
        "q": "pacman",
        "json": "",
        "wt": "json"
      }
    },
    "response": {
      "numFound": 0,
      "start": 0,
      "docs": []
    }
  }
  </code></pre>
  
  <p>Please help in searching object types in Solr.</p>