After PR#10887, you must clear the Solr index and reload the core (DOCS_AND_FREQS_AND_POSITIONS error) #11139
Labels
FY25 Sprint 14
FY25 Sprint 14 (2025-01-02 - 2025-01-15)
Size: 3
A percentage of a sprint. 2.1 hours.
Now that we have merged #10887 (I'm testing a little past that, as of 3352bb7) datasets are created but not indexed when you KEEP your Solr index and only update your schema.xml file (as opposed to reinstalling Solr) and then try to create a dataset using the JSON below with "coverage.Temporal.StartTime".
The full error is below, which includes "Caused by: java.lang.IllegalArgumentException: cannot change field "coverage.Temporal.StartTime" from index options=DOCS_AND_FREQS_AND_POSITIONS to inconsistent index options=DOCS".
Googling for DOCS_AND_FREQS_AND_POSITIONS led me to https://stackoverflow.com/questions/57821414/solr-fails-to-index-text-field which suggested reloading the core and clearing the index (for us http://localhost:8080/api/admin/index/clear clears it), but it simply stopping and starting the containers wasn't working for me (I assumed this would reload the core). Here's how I got the problem to go away:
curl http://localhost:8080/api/admin/index/clear
curl -s 'http://localhost:8983/solr/collection1/select?rows=1000000&wt=json&indent=true&q=*%3A*'
(this is fromscripts/search/query
)curl 'http://localhost:8983/solr/admin/cores?action=RELOAD&core=collection1'
The parent collection should have the astrophysics block enabled, like this:
The dataset JSON comes from the test you can execute with
mvn test -Dtest=SearchIT#testRangeQueries
(this is the test @sekmiller and I noticed was failing for us locally). Here it is: dataset.jsonHere's the command I'm using to create the dataset:
curl -H "X-Dataverse-key:$API_TOKEN" -H 'Content-type:application/json' -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets" --upload-file dataset.json
The response indicates that that dataset was created:
{"status":"OK","data":{"id":143,"persistentId":"doi:10.5072/FK2/MWIDUZ"}}
When the dataset is indexed properly, it should look like this:
Here's the detailed error when indexing is failing:
To close this issue, I'll update the release note in #10887 to explain the extra steps.
The text was updated successfully, but these errors were encountered: