[ 
https://issues.apache.org/jira/browse/SOLR-7697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14592543#comment-14592543
 ] 

Marius Grama commented on SOLR-7697:
------------------------------------

[~steve_rowe] I just had a look over your patch. It is definitely an 
improvement to my initial version. FieldTypeXmlAdapter provides now meaningful 
exception messages.

It looks good to me.

> Schema API doesn't take class or luceneMatchVersion attributes into account 
> for the analyzer when adding a new field type
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-7697
>                 URL: https://issues.apache.org/jira/browse/SOLR-7697
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 5.2
>            Reporter: Marius Grama
>            Assignee: Steve Rowe
>            Priority: Minor
>             Fix For: 5.3, Trunk
>
>         Attachments: SOLR-7697.patch, SOLR-7697.patch
>
>
> I've noticed that in schema.xml can be defined field types like the following 
> :
> {code}
>     <fieldType name="nametext" class="solr.TextField">
>       <analyzer class="org.apache.lucene.analysis.core.WhitespaceAnalyzer"/>
>     </fieldType>
> {code}
> 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
> {code}
>   protected static Element createAnalyzerElement(Document doc, String type, 
> Map<String,?> json) {
>     Element analyzer = doc.createElement("analyzer");
>     if (type != null)
>       analyzer.setAttribute("type", type);
>       .....
> {code}
> If the change would be made, the add-field-type request would look like this :
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to