googleapis / googleapis/google-cloud-node
SearchRequest docs reference relevance_filter_spec, but field is missing from shipped protos
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
### Library Name
@google-cloud/discoveryengine
### Please make sure you have searched for information in the following guides.
- [x] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- [x] Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting
- [x] Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq
- [x] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- [x] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- [x] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
### Documentation Request
```md
#### Environment details
- Package: `@google-cloud/discoveryengine`
- Version: `2.6.0`
- Runtime: Node.js
- API version: `google.cloud.discoveryengine.v1`
- Service: `SearchService.Search`
#### Issue
The generated Discovery Engine `SearchRequest` proto shipped with `@google-cloud/discoveryengine` references `relevance_filter_spec` in the documentation comment for `relevance_threshold`, but the actual `SearchRequest` message does not define a `relevance_filter_spec` field.
In the installed package:
```proto
// The global relevance threshold of the search results.
//
// Defaults to Google defined threshold, leveraging a balance of
// precision and recall to deliver both highly accurate results and
// comprehensive coverage of relevant information.
//
// If more granular relevance filtering is required, use the
// `relevance_filter_spec` instead.
//
// This feature is not supported for healthcare search.
RelevanceThreshold relevance_threshold = 44;
```
However, there is no corresponding field such as:
```proto
RelevanceFilterSpec relevance_filter_spec = ...;
```
There are also no generated TypeScript fields for:
```ts
relevanceFilterSpec
keywordSearchThreshold
semanticSearchThreshold
semanticRelevanceThreshold
```
#### Why this seems like a bug
The public Vertex AI Search / Discovery Engine documentation describes relevance filters using `relevanceFilterSpec`, for example:
```json
{
"relevanceFilterSpec": {
"keywordSearchThreshold": {
"relevanceThreshold": "LOW"
},
"semanticSearchThreshold": {
"semanticRelevanceThreshold": 0.871
}
}
}
```
The installed proto comment also explicitly tells users to use `relevance_filter_spec` for more granular relevance filtering, but the field is unavailable in the generated proto/type surface.
This makes the shipped client/proto internally inconsistent: the documentation comment references a field that cannot be set.
#### Expected behavior
`SearchRequest` should expose the GA relevance filter field, for example:
```ts
const request = {
servingConfig,
query,
relevanceFilterSpec: {
keywordSearchThreshold: {
relevanceThreshold: 'HIGH',
},
semanticSearchThreshold: {
semanticRelevanceThreshold: 0.871,
},
},
};
```
and the generated protos/types should include the corresponding message definitions.
#### Actual behavior
`relevanceFilterSpec` is not present in:
```text
node_modules/@google-cloud/discoveryengine/build/protos/protos.d.ts
node_modules/@google-cloud/discoveryengine/build/protos/google/cloud/discoveryengine/v1/search_service.proto
node_modules/@google-cloud/discoveryengine/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto
node_modules/@google-cloud/discoveryengine/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto
```
The only available relevance filtering field is the older top-level:
```ts
relevanceThreshold?: SearchRequest.RelevanceThreshold
```
#### Reproduction
Install the package and inspect the generated types/protos:
```bash
npm install @google-cloud/discoveryengine@2.6.0
rg -n "relevance_filter_spec|relevanceFilterSpec|semanticRelevanceThreshold|keywordSearchThreshold|semanticSearchThreshold" node_modules/@google-cloud/discoveryengine
```
Observed result:
- The only match for `relevance_filter_spec` is in the comment for `relevance_threshold`.
- No actual proto field or generated TypeScript property exists.
You can also inspect `SearchRequest` directly:
```ts
import { protos } from '@google-cloud/discoveryengine';
type SearchRequest = protos.google.cloud.discoveryengine.v1.ISearchRequest;
// SearchRequest has relevanceThreshold, but not relevanceFilterSpec.
```
#### Impact
Users cannot use the documented granular relevance filtering behavior from the Node.js Discovery Engine client.
This is especially important for search applications that need to tune keyword relevance separately from semantic relevance. The top-level `relevanceThreshold` is too coarse for this use case, and the docs suggest `relevanceFilterSpec` is the intended GA mechanism.
#### Question
Is `relevanceFilterSpec` expected to be available in the GA `v1` Discovery Engine API for Node.js?
If yes, can the Discovery Engine protos / generated Node.js client be updated to include it?
If no, can the proto comment and public documentation be clarified so users do not attempt to use a field that is unavailable in the client?
```
Contributor guide
Assessment
This issue has not been assessed yet.