Skip to content

Elasticsearch index setup#142

Open
Kat-Alo wants to merge 16 commits intomainfrom
elasticsearch-index-setup
Open

Elasticsearch index setup#142
Kat-Alo wants to merge 16 commits intomainfrom
elasticsearch-index-setup

Conversation

@Kat-Alo
Copy link
Copy Markdown

@Kat-Alo Kat-Alo commented Feb 27, 2026

Description

Introduces Elasticsearch index for DeedPage objects, as well as documentation for local set up. This PR includes a new API search endpoint but does not update the search page in the application. That will come in the next PR.

Testing

Comment thread apps/deed/documents.py
# (larger value means fewer queries, but more memory usage)
queryset_pagination = 500

def get_queryset(self):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is, I think, the biggest performance win from reevaluating the indexing. Basically, we are gathering all the fields, including on other models, at the start so that we don't have to do it for every row we're indexing.

Comment thread apps/deed/documents.py


@registry.register_document
class DeedPageDocument(Document):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Defines the actual elasticsearch index of DeedPage objects

Comment thread apps/deed/views.py
data = super().get_context_data(**kwargs)
data['all_workflows'] = ZooniverseWorkflow.objects.all()
return data No newline at end of file
def generate_search_query(self, search_terms_list: list[str], param_filters: dict):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We can play with this function if we don't like the number of results returned

@Kat-Alo Kat-Alo marked this pull request as ready for review March 17, 2026 13:43
@Kat-Alo Kat-Alo requested a review from mikejcorey March 17, 2026 13:53
@mtigas mtigas assigned mtigas and unassigned mtigas Apr 24, 2026
@mtigas mtigas self-requested a review April 24, 2026 15:55
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.

2 participants