Change dynamic field title in solr select query
<p>I am using solr to retrieve results from a cassandra table.</p>

<p><strong>Table structure:</strong></p>

<pre><code>CREATE TABLE mytable (
  field1 uuid,
  field2 text ,
  bfield blob,
  custmdata_&lt;text, text&gt;,
  PRIMARY KEY (field1)
);
</code></pre>

<p><strong>Table content</strong></p>

<pre><code>INSERT INTO mytable  VALUES ( 62c36092-82a1-3a00-93d1-46196ee77204,"test1", { 'custmdata_data1'  : 'data1value', 'custmdata_data2' : 'data2value' });
INSERT INTO mytable  VALUES ( e26690db-dd54-4b61-b002-d3c07125f359,"test2", { 'custmdata_data5'  : 'data5value', 'custmdata_data1' : 'mydata1value' });
</code></pre>

<p>I am able to retrieve the results using solr query.</p>

<pre><code>{
  "responseHeader": {
    "status": 0,
    "QTime": 1
  },
  "response": {
    "numFound": 2,
    "start": 0,
    "docs": [
      {
        "field1": "62c36092-82a1-3a00-93d1-46196ee77204",
        "field2": "test1",
         "custmdata_data1":"data1value",
         "custmdata_data2" : "data2value"
      },
      {
        "field1": "e26690db-dd54-4b61-b002-d3c07125f359",
        "field2": "test2",
         "custmdata_data5":"data5value",
         "custmdata_data1" : "mydata1value"
      }
    ]
  }
}
</code></pre>

<p>Is there any way to specify the field name in result so that I can retrieve the dynamic fields without having the field name prefix? I need result like this:</p>

<pre><code>{
      "responseHeader": {
        "status": 0,
        "QTime": 1
      },
      "response": {
        "numFound": 2,
        "start": 0,
        "docs": [
          {
            "field1": "62c36092-82a1-3a00-93d1-46196ee77204",
            "field2": "test1",
             "data1":"data1value",
             "data2" : "data2value"
          },
          {
            "field1": "e26690db-dd54-4b61-b002-d3c07125f359",
            "field2": "test2",
             "data5":"data5value",
             "data1" : "mydata1value"
          }
        ]
      }
    }
</code></pre>

<p><strong>Update:</strong>
From datastax documentaion, I found that,</p>

<blockquote>
  <p>Avoid or limit the use of dynamic fields. Lucene allocates memory for
  each unique field (column) name, so if you have a row with columns A,
  B, C, and another row with B, D, E, Lucene allocates 5 chunks of
  memory. For millions of rows, the heap is unwieldy.</p>
</blockquote>

<p>So is there a better way to achieve dynamic field based filtering in Solr? What I need is to filter against custom fields that may vary for each insert.</p>