hypothesis / hypothesis/product-backlog

Annotation search API does not immediately return new annotations

Open
#651 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
122
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Newly created or updated annotations are indexed asynchronously in Elasticsearch. This means that the search API (`/api/search`) does not guarantee to immediately return an annotation that has just been created or updated when a relevant query is executed. Instead the annotation will only be visible after a short delay, consisting of the time for a worker to execute the indexing task and the time for an Elasticsearch index refresh to happen. I haven't measured but I expect it would typically be about a second (that is the approximate default Elasticsearch refresh delay). It could be more if there is a backlog of annotations to index for any reason.

This hasn't caused any problems for us so far, but there are use cases where conceivably it could be an issue. I'm opening this issue as a place to collect details of such use cases.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the /api/search endpoint, asynchronous annotation indexing, and Elasticsearch refresh behavior, but no repository files or tests. Start by collecting concrete freshness use cases and confirming the desired search-consistency guarantee; the work is done only when that requirement and its acceptance checks are defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch
Domain
api, search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.