0

I am trying to insert/update the solr document into solr collection

"ACCT_ID:"1234"
"ACCOUNT_NAME:"Test",
"ACCT_Address":"",

In Solr5 i am not getting any error if the input/update fields not available in solr schema. for example ACCT_Address is the field which is not available in schema and i am not getting any error.

But in Solr6 i am getting failure error saying that "Error from server undefined field: ACCT_Address".

In our data we might get some invalid fields also

How to fix this issue for solr6? I am connecting using CloudSolrClient with zookeeper host.how to resolve this issue.

client = new CloudSolrClient.Builder().withZkHost(zkHostName).withHttpClient(getHttpClient()).build();

Why is this issue coming in solr6?

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Whether undefined files error out or not depends on your schema, in addition to whether or not you're using the schemaless mode. It's not related to how you're using the client. Also - Solr6 is (very) old and should be upgraded as well. See https://solr.apache.org/guide/solr/latest/indexing-guide/schemaless-mode.html for the schemaless mode, see https://solr.apache.org/guide/solr/latest/indexing-guide/dynamic-fields.html for dynamic fields - i.e. where a wildcard matches the field name. – MatsLindh Mar 24 '23 at 12:04
  • @MatsLindh Thanks for your answer.That means to work with undefined fields in solr6.6.6 i need to use schema less mode or dynamic fields.Is there any option to specify like ignore the undefined fields while updating documents or any other way is there? I don't need to insert/update the undefined fields in the document.Just i need to ignore those undefined ones.As of now currently we are using solr 5.5.3 which is ignoring the undefined fields while inserting/updating documents in collection.Whats needs to do to achieve the same functionality in solr 6.6.6.Please suggest on this.Thankyou – World of Titans Mar 24 '23 at 13:04
  • In that case you add a dynamic field with the name `*` and set it as the type `ignored` . See https://stackoverflow.com/questions/46509259/solr-7-managed-schema-how-to-ignore-unnamed-fields for the relevant definitions and field type. – MatsLindh Mar 24 '23 at 13:07
  • @MatsLindh Thankyou so much for the reply .One final question .Solr 6.6.6 is ignoring unnamed fields while inserting documents .Only in the case of update only i am getting unnamed field error. In Solr 6.6.6 it will not ignore unnamed fields while updating? Can I find documentation anywhere about not ignoring unnamed fields in Solr 6.6.6 for update. I need this to show it to our management for confirmation. Can you please suggest about this. Thankyou – World of Titans Mar 24 '23 at 13:17
  • Sorry, I don't have any references for any changed behavior in that way; you'd have to comb through the changelog between the versions you're upgrading from and to, or refer to the source. However, if you have added the ignored information to the schema, fields should be ignored when issuing updates as well, but it could depend on how you're trying to update the field. Generally updating a document means that a document is reassembled from the stored fields for a document, and then resubmitted, so I'd think any `ignored` entries would be ignored then as well. – MatsLindh Mar 24 '23 at 13:31

0 Answers0