You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steve Rowe (JIRA)" <ji...@apache.org> on 2015/06/19 00:14:01 UTC

[jira] [Resolved] (SOLR-7697) Schema API doesn't take class or luceneMatchVersion attributes into account for the analyzer when adding a new field type

     [ https://issues.apache.org/jira/browse/SOLR-7697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Rowe resolved SOLR-7697.
------------------------------
    Resolution: Fixed

Committed to trunk and branch_5x.

Thanks Marius!

> 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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org