Skip to content

Commit 978555b

Browse files
authored
Merge branch 'main' into update-documentation-re-autocomplete
2 parents f347afa + 90211a8 commit 978555b

10 files changed

Lines changed: 30 additions & 28 deletions

File tree

Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GEM
3939
base64 (0.3.0)
4040
benchmark (0.5.0)
4141
bigdecimal (4.1.2)
42-
bootsnap (1.23.0)
42+
bootsnap (1.24.3)
4343
msgpack (~> 1.2)
4444
brakeman (8.0.4)
4545
racc
@@ -206,13 +206,13 @@ GEM
206206
net-http (0.9.1)
207207
uri (>= 0.11.1)
208208
nio4r (2.7.5)
209-
nokogiri (1.19.2-aarch64-linux-gnu)
209+
nokogiri (1.19.3-aarch64-linux-gnu)
210210
racc (~> 1.4)
211-
nokogiri (1.19.2-arm64-darwin)
211+
nokogiri (1.19.3-arm64-darwin)
212212
racc (~> 1.4)
213-
nokogiri (1.19.2-x86_64-darwin)
213+
nokogiri (1.19.3-x86_64-darwin)
214214
racc (~> 1.4)
215-
nokogiri (1.19.2-x86_64-linux-gnu)
215+
nokogiri (1.19.3-x86_64-linux-gnu)
216216
racc (~> 1.4)
217217
opentelemetry-api (1.9.0)
218218
logger

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# search-api-v2
2-
API and synchronisation worker for general site search on GOV.UK
2+
API and synchronisation worker for general site search on GOV.UK.
33

4-
This application powers the new site search for GOV.UK using Google Cloud Platform (GCP)'s [Vertex
5-
AI Search][vertex-docs] ("Discovery Engine") product as its underlying search engine. It provides
4+
This application powers the new site search for GOV.UK using Google Cloud Platform (GCP)'s [Agent
5+
Search][agent-search-docs] ("Discovery Engine") product as its underlying search engine. It provides
66
two core pieces of functionality:
77
- An API that is "minimally compatible" with the existing `search-api` REST interface to the extent
88
necessary to power the ["site search" (`/search/all`) finder][search-all-finder].
@@ -31,7 +31,7 @@ make search-api-v2
3131
#### Prerequisites
3232

3333
1. You must be a member of the integration gcp access google group: govuk-gcp-access-integration@digital.cabinet-office.gov.uk
34-
2. You will need the email address of the custom search-api-v2 integration service account. This is the service account used by Search API v2 running in integration to authenticate its requests to Google Vertex AI Search.
34+
2. You will need the email address of the custom search-api-v2 integration service account. This is the service account used by Search API v2 running in integration to authenticate its requests to Discovery Engine.
3535

3636
The email address can be found under *IAM and admin > Service Accounts* in the __Search API V2 Integration__ project at https://console.cloud.google.com.
3737

@@ -103,14 +103,14 @@ time being, it is intentionally not a complete replacement for [Search API][sear
103103
See [Search API compatibility](docs/search_api_compatibility.md) for more information about our
104104
compatibility design choices.
105105

106-
## "Vertex" vs "Discovery Engine"
107-
The marketing name of the search product we use (_Google Vertex AI Search and Conversation_) has
108-
undergone several changes while this application was first developed, and some concepts have
109-
different naming in the Google Cloud Platform UI compared to the actual underlying APIs themselves.
106+
## "Agent Search" vs "Discovery Engine"
107+
The marketing name of the search product we use (_Google Cloud Agent Search_) has
108+
undergone several changes since this application was first developed, and some concepts have
109+
different naming in the Google Cloud Platform UI compared to the actual underlying APIs.
110110

111-
We have chosen to exclusively use the more stable API naming (_Discovery Engine_, _engine_ instead
111+
We prefer to use the more stable API naming (_Discovery Engine_, _engine_ instead
112112
of _app_, etc.) throughout the codebase and documentation to avoid having to rename things as the
113-
product reached general availability, but you may see the terms "Vertex" or "Vertex Search" as well
113+
product reached general availability, but you may see the terms "Agent Search" as well
114114
as some other marketing terms used in some project artefacts.
115115

116116
## Related projects
@@ -120,7 +120,7 @@ as some other marketing terms used in some project artefacts.
120120
replicates
121121
- [`search-api-v2-beta-features`][search-api-v2-beta-features]: Runs evaluations for site-search. Also used to experiment with Google Discovery Engine beta features.
122122

123-
[vertex-docs]: https://cloud.google.com/generative-ai-app-builder/docs/introduction
123+
[agent-search-docs]: https://cloud.google.com/generative-ai-app-builder/docs/introduction
124124
[search-all-finder]: https://www.gov.uk/search/all
125125
[govuk-docker]: https://github.com/alphagov/govuk-docker
126126
[env]: https://github.com/alphagov/govuk-docker/blob/main/projects/search-api-v2/docker-compose.yml

app/models/concerns/publishing_api/metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def metadata
4040
document_type: document_hash[:document_type],
4141
content_purpose_supergroup: document_hash[:content_purpose_supergroup],
4242
part_of_taxonomy_tree:,
43-
# Vertex can only currently boost on numeric fields, not booleans
43+
# Discovery Engine can only currently boost on numeric fields, not booleans
4444
is_historic: historic? ? 1 : 0,
4545
government_name:,
4646
organisation_state:,

app/services/discovery_engine/query/search.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def order_by
9090
DEFAULT_ORDER_BY
9191
else
9292
# This helps us spot clients that are sending unexpected values and probably should continue
93-
# to use the previoius search-api instead of this API.
93+
# to use the previous search-api instead of this API.
9494
Rails.logger.warn("Unexpected order_by value: #{query_params[:order].inspect}")
9595
DEFAULT_ORDER_BY
9696
end
@@ -110,7 +110,7 @@ def boost_spec
110110
end
111111

112112
def news_recency_boost_specs
113-
# Since we first created `NewsRecencyBoost`, Vertex AI Search has gained the equivalent
113+
# Since we first created `NewsRecencyBoost`, Discovery Engine has gained the equivalent
114114
# functionality natively. As of Mar 2025, we are AB testing this new feature on the `variant`
115115
# serving configuration, so we do not want to apply our custom boost if that is the serving
116116
# config used for the current search, as it would cause content to be boosted twice.

app/services/metrics/exported.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ module Exported
1818
"total time taken to process an incoming message from Publishing API (seconds)",
1919
buckets: [0.1, 0.5, 1, 2, 5],
2020
),
21-
### VAIS response duration histograms
21+
### Discovery Engine (perviously marketed as "Vertex AI Search") response duration histograms
2222
vertex_search_request_duration: CLIENT.register(
2323
:histogram,
2424
"search_api_v2_vertex_search_request_duration",
25-
"total time taken for google vertex to respond to a search request (seconds)",
25+
"total time taken for google cloud discovery engine to respond to a search request (seconds)",
2626
buckets: [0.1, 0.5, 1, 2, 5],
2727
),
2828
vertex_autocomplete_request_duration: CLIENT.register(
2929
:histogram,
3030
"search_api_v2_vertex_autocomplete_request_duration",
31-
"total time taken for google vertex to respond to an autocomplete request (seconds)",
31+
"total time taken for google cloud discovery engine to respond to an autocomplete request (seconds)",
3232
buckets: [0.1, 0.5, 1, 2, 5],
3333
),
3434
search_controller_request_duration: CLIENT.register(

config/best_bets.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ shared:
3939
"evacuation": /government/news/foreign-office-travel-advice-updates
4040
"middle east": /government/news/foreign-office-travel-advice-updates
4141
"doha": /foreign-travel-advice/qatar
42+
"chat": /guidance/download-the-govuk-app
43+
"gov.uk chat": /guidance/download-the-govuk-app
4244

4345
test:
4446
"i want to test a single best bet": /here/you/go

docs/openapi/specification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ components:
475475
The suggested query text with highlighting.
476476
477477
Note that this is always just the entire `text` property wrapped in `<mark>` tags as
478-
Vertex AI Search does not provide highlighting for individual parts of the query.
478+
Discovery Engine does not provide highlighting for individual parts of the query.
479479
example: "<mark>driving test</mark>"
480480

481481
AutocompleteResponse:

docs/search_autocomplete.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Search autocomplete
2-
We use Vertex AI Search's [built-in autocomplete functionality][vais-ac] to provide our users with
2+
We use Discovery Engine's [built-in autocomplete functionality][discovery-engine-ac] to provide our users with
33
helpful suggestions to complete their query as they type in search fields.
44

55
Search API v2 provides an API to return suggestions, which the [`search_with_autocomplete`
@@ -31,6 +31,6 @@ This will cause an empty array of suggestions to be returned to all clients (web
3131

3232
[component]: https://components.publishing.service.gov.uk/component-guide/search_with_autocomplete
3333
[ff-proxy]: https://github.com/alphagov/finder-frontend/blob/main/app/controllers/api/autocompletes_controller.rb
34-
[vais-ac]: https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete
34+
[discovery-engine-ac]: https://cloud.google.com/generative-ai-app-builder/docs/configure-autocomplete
3535
[values-production.yaml]: https://github.com/alphagov/govuk-helm-charts/blob/main/charts/app-config/values-production.yaml
3636
[search-admin-denylist]: https://search-admin.publishing.service.gov.uk/completion_denylist_entries

lib/tasks/document_sync_worker.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace :document_sync_worker do
99
bunny = Bunny.new
1010
channel = bunny.start.create_channel
1111
exch = Bunny::Exchange.new(channel, :topic, "published_documents")
12-
channel.queue(ENV.fetch("PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME")).bind(exch, routing_key: "*.*")
12+
channel.queue(ENV.fetch("PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME"), durable: true).bind(exch, routing_key: "*.*")
1313
end
1414

1515
desc "Listens to and processes messages from the published documents queue"

spec/lib/tasks/document_sync_worker_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@
100100
name = ENV.fetch("PUBLISHED_DOCUMENTS_MESSAGE_QUEUE_NAME")
101101
queue = instance_double(Bunny::Queue, name: name, bind: nil)
102102

103-
allow(channel).to receive(:queue).with(name).and_return(queue)
103+
allow(channel).to receive(:queue).with(name, anything).and_return(queue)
104104

105105
Rake::Task[task_name].invoke
106-
expect(channel).to have_received(:queue).with(name)
106+
expect(channel).to have_received(:queue).with(name, durable: true)
107107
expect(queue).to have_received(:bind).with(exchange, routing_key: "*.*")
108108
end
109109
end

0 commit comments

Comments
 (0)