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/16 20:22:01 UTC

[jira] [Updated] (SOLR-7682) Schema API - Add New Copy Field Rule doesn't allow maxChars parameter

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

Steve Rowe updated SOLR-7682:
-----------------------------
    Attachment: SOLR-7682.patch

Patch adding maxChars support and modifying {{TestBulkSchemaAPI}} to test for it.

I'll commit after all solr tests and precommit pass.

> Schema API - Add New Copy Field Rule doesn't allow maxChars parameter
> ---------------------------------------------------------------------
>
>                 Key: SOLR-7682
>                 URL: https://issues.apache.org/jira/browse/SOLR-7682
>             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-7682.patch
>
>
> As shown in the Schema API documentation
> https://cwiki.apache.org/confluence/display/solr/Schema+API#SchemaAPI-AddaNewCopyFieldRule
>  when adding a new copy field rule, the _maxChars_ argument can be also specified.
> When trying to execute the request : 
> {code}
> curl -X POST -H 'Content-type:application/json' --data-binary '{
>   "add-copy-field":{
>      "source":"name",
>      "dest":[ "secondname"],
>      "maxChars" : "3000"}
> }' http://localhost:8983/solr/films/schema
> {code}
> (after creating a core {code}bin/solr create -c films{code}, and creating two text fields
> {code}
> curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
>     "add-field" : {
>         "name":"name",
>         "type":"text_general",
>         "stored":true
>     },
>    "add-field" : {
>         "name":"secondname",
>         "type":"text_general",
>         "stored":true
>     }
> }'
> {code}
> the error message shown is 
> {code}
>   "responseHeader":{
>     "status":0,
>     "QTime":1},
>   "errors":[{
>       "add-copy-field":{
>         "source":"name",
>         "dest":["secondname"],
>         "maxChars":"3000"},
>       "errorMessages":["Only the 'source' and 'dest' params are allowed with the 'add-copy-field' operation"]}]}
> {code}
> which occurs due to the handling in SchemaManager.java file
> {code}
>         if ( ! op.getValuesExcluding(SOURCE, DESTINATION).isEmpty()) {
>           op.addError("Only the '" + SOURCE + "' and '" + DESTINATION
>               + "' params are allowed with the 'add-copy-field' operation");
>           return false;
>         }
> {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