I've been chained dataimporthandler with schemaless mode. add config param "add-unknown-fields-to-the-schema" to dataimporthandler as seen below and configure everything. Dataimporthandler imports data and works well but solr can't add unknown field to schema. It only works for existing fields. Here is dataimporthandler answer to request.
{
"responseHeader": {
"status": 0,
"QTime": 0
},
"initArgs": [
"defaults",
[
"update.chain",
"add-unknown-fields-to-the-schema",
"config",
"db-data-config.xml"
]
],
"command": "status",
"status": "idle",
"importResponse": "",
"statusMessages": {
"Total Requests made to DataSource": "1",
"Total Rows Fetched": "273",
"Total Documents Processed": "273",
"Total Documents Skipped": "0",
"Full Dump Started": "2016-06-21 13:29:48",
"": "Indexing completed. Added/Updated: 273 documents. Deleted 0 documents.",
"Committed": "2016-06-21 13:29:49",
"Time taken": "0:0:0.543"
}
}
You can see that my configuration is alright. below is solrconfig file.
<requestHandler name="/dataimport" class="solr.DataImportHandler">
<lst name="defaults">
<str name="update.chain">add-unknown-fields-to-the-schema</str>
<str name="config">db-data-config.xml</str>
</lst>
I want to be able to add unknown fields from database.