You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2021/01/07 18:24:00 UTC

[jira] [Reopened] (SOLR-14950) schema api sometimes fails to replace-field-type

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

Chris M. Hostetter reopened SOLR-14950:
---------------------------------------

reliably reproducing test failures on branch_8x, first noted by tim potter on the mailing list, and easily reproducible by me...

{noformat}
   [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=TestBulkSchemaAPI -Dtests.method=testCopyFieldWithReplace -Dtests.seed=7657D4FA16A76DC8 -Dtests.slow=true -Dtests.badapples=true -Dtests.locale=es-UY -Dtests.timezone=America/Resolute -Dtests.asserts=true -Dtests.file.encoding=UTF-8
   [junit4] FAILURE 3.11s | TestBulkSchemaAPI.testCopyFieldWithReplace <<<
   [junit4]    > Throwable #1: java.lang.AssertionError: {
   [junit4]    >   "responseHeader":{
   [junit4]    >     "status":400,
   [junit4]    >     "QTime":26},
   [junit4]    >   "error":{
   [junit4]    >     "metadata":[
   [junit4]    >       "error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject",
   [junit4]    >       "root-error-class","org.apache.solr.api.ApiBag$ExceptionWithErrObject"],
   [junit4]    >     "details":[{
   [junit4]    >         "add-field-type":{
   [junit4]    >           "name":"myNewTextField",
   [junit4]    >           "class":"solr.TextField",
   [junit4]    >           "analyzer":{
   [junit4]    >             "charFilters":[{
   [junit4]    >                 "name":"patternReplace",
   [junit4]    >                 "replacement":"$1$1",
   [junit4]    >                 "pattern":"([a-zA-Z])\\\\1+"}],
   [junit4]    >             "tokenizer":{"name":"whitespace"},
   [junit4]    >             "filters":[{"name":"asciiFolding"}]}},
   [junit4]    >         "errorMessages":["Every charFilter must define a class property!\n"]}],
   [junit4]    >     "msg":"error processing commands",
   [junit4]    >     "code":400}}
   [junit4]    >  expected null, but was:<{metadata=[error-class, org.apache.solr.api.ApiBag$ExceptionWithErrObject, root-error-class, org.apache.solr.api.ApiBag$ExceptionWithErrObject], details=[{add-field-type={name=myNewTextField, class=solr.TextField, analyzer={charFilters=[{name=patternReplace, replacement=$1$1, pattern=([a-zA-Z])\\1+}], tokenizer={name=whitespace}, filters=[{name=asciiFolding}]}}, errorMessages=[Every charFilter must define a class property!
   [junit4]    > ]}], msg=error processing commands, code=400}>
   [junit4]    > 	at __randomizedtesting.SeedInfo.seed([7657D4FA16A76DC8:B096864C3F5D3F33]:0)
   [junit4]    > 	at org.apache.solr.rest.schema.TestBulkSchemaAPI.testCopyFieldWithReplace(TestBulkSchemaAPI.java:734)
   [junit4]    > 	at java.lang.Thread.run(Thread.java:748)
   [junit4]   2> NOTE: leaving temporary files on disk at: /home/hossman/lucene/alt_dev/solr/build/solr-core/test/J0/temp/solr.rest.schema.TestBulkSchemaAPI_7657D4FA16A76DC8-001
   [junit4]   2> NOTE: test params are: codec=Asserting(Lucene87): {}, docValues:{}, maxPointsInLeafNode=252, maxMBSortInHeap=5.5044488302753045, sim=Asserting(RandomSimilarity(queryNorm=false): {}), locale=es-UY, timezone=America/Resolute
   [junit4]   2> NOTE: Linux 5.4.0-47-generic amd64/AdoptOpenJDK 1.8.0_222 (64-bit)/cpus=8,threads=1,free=460545360,total=521142272
   [junit4]   2> NOTE: All tests run in this JVM: [TestBulkSchemaAPI]
   [junit4] Completed [1/1 (1!)] in 4.11s, 1 test, 1 failure <<< FAILURES!
   [junit4] 
   [junit4] 
   [junit4] Tests with failures [seed: 7657D4FA16A76DC8]:
   [junit4]   - org.apache.solr.rest.schema.TestBulkSchemaAPI.testCopyFieldWithReplace

{noformat}

> schema api sometimes fails to replace-field-type
> ------------------------------------------------
>
>                 Key: SOLR-14950
>                 URL: https://issues.apache.org/jira/browse/SOLR-14950
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Schema and Analysis
>    Affects Versions: 8.4.1
>            Reporter: Andrew Shumway
>            Assignee: Munendra S N
>            Priority: Minor
>              Labels: schema
>             Fix For: 8.8
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> When updating a schema via POST to  {{/solr/COLLECTION/schema}} using  {{replace-field-type}} , the call fails if the schema has existing copy-fields whose destination references a non-dynamic field of the  {{field-type}} which is being updated.
>  
> Example steps: # on a blank schema, add a field type and copy-field by POSTing
> {
>   "add-field-type": [
>     {
>       "name": "spellcheck", "class": "solr.TextField","positionIncrementGap": "100",
>       "analyzer": {
>         "tokenizer": {
>           "class": "solr.StandardTokenizerFactory"
>         }
>       }
>     }
>   ],
>   "add-field": [
>     {
>       "name": "spellcheck",  "type": "spellcheck",
>       "multiValued": true, "indexed": true, "stored": true
>     }
>   ],
>   "add-copy-field": [
>     {
>       "source": "important_data_s",
>       "dest": "spellcheck"
>     }
>   ]
> }
> 2. Later, send an update for the field type
> {
>   "replace-field-type": [
>     {
>       "name": "spellcheck", "class": "solr.TextField","positionIncrementGap": "100",
>       "analyzer": {
>         "tokenizer": {
>           "class": "solr.StandardTokenizerFactory"
>         }
>       }
>     }
>   ]
> }
> This results in {{"errorMessages":["Source or Destination SchemaField can't be NULL.\n"]}],}}The error does not trigger if, as mentioned above, the destination of the existing copy-field is dynamic OR if the source field mapping contains a wildcard e.g. {{*foo_s}} (edited) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org