Skip to content

Remove Autocomplete and just rely on Search - #78

Merged
JackLewis-digirati merged 4 commits into
mainfrom
fix/autocompleteSearch
Nov 13, 2026
Merged

JackLewis-digirati merged 4 commits into
mainfrom
fix/autocompleteSearch

Conversation

@JackLewis-digirati

@JackLewis-digirati JackLewis-digirati commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What does this change?

Resolves #74

This PR makes it so that jobs will automatically receive autocomplete whenever Search is asked for. Secondly, as Search now gives Autocomplete, this value has been retired and will be ignored if it's asked for

@JackLewis-digirati

JackLewis-digirati commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

How this works

Resolves #74. IIIF only defines autocomplete as a service nested inside a search service, so autocomplete can't be advertised in a Manifest on its own. This PR removes the Autocomplete flag: Search now provides both search and autocomplete.

Before

Search (1) and Autocomplete (2) were separate flags, each building and gating its own artefact and endpoints:

Requested services Built Manifest advertised
Search + Autocomplete search + autocomplete search services with nested autocomplete
Search only search search services with no nested autocomplete
Autocomplete only autocomplete nothing, so the autocomplete index couldn't be found from the Manifest

After

1. The Autocomplete flag is removed. JobServices no longer has an Autocomplete member. Value 2 (1 << 1) is retired and must not be reused, because stored jobs and capabilities files may still have it set. It is ignored, and requests that set it are not rejected, so -1 (all services) keeps working.

2. Search builds and enables both.

  • TextBuildJob saves the AutoComplete index whenever Search is set, and no longer records autocomplete separately in FulfilledServices.
  • The /autocomplete/v1 and /autocomplete/v2 endpoints are gated on Search.
  • JobResponse returns autocompleteV1/autocompleteV2 whenever Search was fulfilled.

3. The text-augmented Manifest always nests autocomplete inside search. The search services are still only added when Search is enabled.

Enabled Manifest service
Search SearchService2 and SearchService1, each with a nested AutoCompleteService
no Search (e.g. Pdf, Svg, or only the retired value 2) no search services and no search @context

For example, a job with Search enabled produces:

"service": [
  {
    "id": "https://example.org/search/v2/my-book",
    "type": "SearchService2",
    "service": [
      { "id": "https://example.org/autocomplete/v2/my-book", "type": "AutoCompleteService2" }
    ]
  },
  {
    "id": "https://example.org/search/v1/my-book",
    "type": "SearchService1",
    "profile": "http://iiif.io/api/search/1/search",
    "service": [
      { "id": "https://example.org/autocomplete/v1/my-book", "type": "AutoCompleteService1", "profile": "http://iiif.io/api/search/1/autocomplete" }
    ]
  }
]

Existing jobs

  • Jobs stored with Search | Autocomplete (3) behave exactly as Search.
  • A job stored with 2 but not 1 builds neither search nor autocomplete when it is reprocessed.
  • No migration is needed, and no other flag values change. The default services: -1 behaves as before.

Docs

docs/builder-api.md and docs/search-api.md list value 2 as retired and Search as covering autocomplete. The decision is recorded in instructions/decisions.md.

Tests

  • TextBuildJobTests: Search alone saves both Text and AutoComplete; the retired value 2 alone saves neither and doesn't fulfil Search.
  • TextAugmentedHandlerTests: Search gives search services with nested autocomplete; Pdf, Svg or the retired value 2 without Search give no search services or search context.
  • JobResponseTests and CapabilityGatingTests: autocomplete URLs and endpoints follow Search.
  • E2E: a Search-only job returns 200 from both /search and /autocomplete; a job without Search returns 404 from both; reprocessing from FullText to Search makes autocomplete available.

@JackLewis-digirati
JackLewis-digirati marked this pull request as ready for review November 5, 2026 10:59
@JackLewis-digirati
JackLewis-digirati requested a review from a team as a code owner November 5, 2026 10:59
@JackLewis-digirati JackLewis-digirati changed the title Autocomplete implies search service Remove Autocomplete and just rely on search service Nov 12, 2026
@JackLewis-digirati JackLewis-digirati changed the title Remove Autocomplete and just rely on search service Remove Autocomplete and just rely on Search Nov 12, 2026

@donaldgray donaldgray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM - both the ## How this works and linked ticket read like we still support Autocomplete, rather than having removed it.

These should both be updated.

Comment thread src/TextServices.Storage/JobServices.cs Resolved
Comment thread docker-compose.yml Resolved
@JackLewis-digirati
JackLewis-digirati merged commit 457833f into main Nov 13, 2026
4 checks passed
@JackLewis-digirati
JackLewis-digirati deleted the fix/autocompleteSearch branch November 13, 2026 15:32
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.

text services treats autocomplete and search flags as the same

2 participants