Repository navigation
Add document_type facet to Dossiers - #143
Merged
Merged
Conversation
xmedr
reviewed
Sep 22, 2026
xmedr
left a comment
Collaborator
There was a problem hiding this comment.
I'm having trouble rebuilding the index. I get this error and it prevents me from being able to search dossiers, despite having one with a value in that new field. What do you think?
Indexing 26459 dossiers
Failed to add documents to Solr: Solr responded with an error (HTTP 400): [Reason: ERROR: [doc=docsearch.dossier.3002] unknown field 'document_type']
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/haystack/backends/solr_backend.py", line 76, in update
self.conn.add(docs, commit=commit, boost=index.get_field_weights())
File "/usr/local/lib/python3.6/site-packages/pysolr.py", line 918, in add
overwrite=overwrite, handler=handler)
File "/usr/local/lib/python3.6/site-packages/pysolr.py", line 500, in _update
return self._send_request('post', path, message, {'Content-type': 'text/xml; charset=utf-8'})
File "/usr/local/lib/python3.6/site-packages/pysolr.py", line 412, in _send_request
raise SolrError(error_message % (resp.status_code, solr_message))
pysolr.SolrError: Solr responded with an error (HTTP 400): [Reason: ERROR: [doc=docsearch.dossier.3002] unknown field 'document_type']
Failed to add documents to Solr: Solr responded with an error (HTTP 400): [Reason: ERROR: [doc=docsearch.dossier.26459] unknown field 'document_type']
Collaborator
Author
|
@xmedr strange I don't get that error. Have you tried restarting your containers before doing the rebuild? |
xmedr
approved these changes
Sep 22, 2026
xmedr
left a comment
Collaborator
There was a problem hiding this comment.
I had tried restarting my containers and that didn't work, but I just rebuilt my containers from scratch, and that solved the problem!
All works as expected now
Collaborator
Author
|
@xmedr Great. I think that warrants some extra testing on staging to make sure this change doesn't do something unexpected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
See title.
Closes #136
Demo
Testing Instructions
docker compose run --rm app python manage.py rebuild_index