Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
5.2
-
None
Description
I've noticed that in schema.xml can be defined field types like the following :
<fieldType name="nametext" class="solr.TextField"> <analyzer class="org.apache.lucene.analysis.core.WhitespaceAnalyzer"/> </fieldType>
The current add-field-type update operation from Schema API doesn't take into account the class (and the luceneMatchVersion - see FieldTypePluginLoader.java) for the field type analyzer definition, but only their type.
See FieldTypeXmlAdapter.java
protected static Element createAnalyzerElement(Document doc, String type, Map<String,?> json) { Element analyzer = doc.createElement("analyzer"); if (type != null) analyzer.setAttribute("type", type); .....
If the change would be made, the add-field-type request would look like this :
curl -X POST -H 'Content-type:application/json' --data-binary '{ "add-field-type": { "name": "nametext", "class": "solr.TextField", "analyzer": { "class": "org.apache.lucene.analysis.core.WhitespaceAnalyzer" } } }' http://localhost:8983/solr/gettingstarted/schema
Attachments
Attachments
Issue Links
- relates to
-
SOLR-7182 Make the Schema-API a first class citizen of SolrJ
- Closed