Skip to content

Add document_type facet to Dossiers - #143

Merged
antidipyramid merged 3 commits into
masterfrom
feature/136-dossier
Sep 22, 2026
Merged

antidipyramid merged 3 commits into
masterfrom
feature/136-dossier

Conversation

@antidipyramid

Copy link
Copy Markdown
Collaborator

Overview

See title.

Closes #136

Demo

Screenshot 2026-09-21 at 3 35 03 PM

Testing Instructions

  • Bring up the app locally
  • Rebuild your index with docker compose run --rm app python manage.py rebuild_index
  • Verify that you can facet on Dossier document type

@antidipyramid
antidipyramid requested a review from xmedr September 21, 2026 20:00

@xmedr xmedr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']

@antidipyramid

Copy link
Copy Markdown
Collaborator Author

@xmedr strange I don't get that error. Have you tried restarting your containers before doing the rebuild?

@xmedr xmedr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@antidipyramid

Copy link
Copy Markdown
Collaborator Author

@xmedr Great. I think that warrants some extra testing on staging to make sure this change doesn't do something unexpected.

@antidipyramid
antidipyramid merged commit 6e0cf99 into master Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Document Type field to Dossier

2 participants