Reputation: 3563
While working with Solr, I get this error:
ERROR:unknown field 'name'
But, I have defined this field in my schema.xml :
<field name="name" type="string" indexed="false"
stored="true" required="true" elementForm="INPUTHIDDEN" />
I get this error when I try to add the field to the documment which is going to be commited:
doc.addField("name", getName());
solrClient.addDocument(doc);
Any ideas? Thanks in advance.
Upvotes: 11
Views: 26765
Reputation: 11
i had the same issue, and i found a solution
i did this i got the error unknown field so i looked up in the schema of solr (schema.xml) and i found
i used store that is specified in the schema. you do the same. you should look for a field declared the same way as yours or use commands to add your field ( i don't know very much these, but you gonna find it ;) )
Upvotes: 1
Reputation: 7944
If you want to verify your index configuration within Solr, you can use the /admin/luke
handler commonly defined in the solrconfig.xml. The output will give you information about the fields that are defined in the schema that Solr has loaded.
If you don't see your name
field in there, you should double check that you've updated your schema.xml in the correct location for your index, and that the appropriate Solr core (or Solr itself) has since been restarted to load the changes.
Upvotes: 6