Skip to content

Commit 86fee9f

Browse files
1 parent aea1ec4 commit 86fee9f

7 files changed

Lines changed: 394 additions & 24 deletions

src/DiscoveryEngine/GoogleCloudDiscoveryengineV1SearchRequest.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,12 @@ class GoogleCloudDiscoveryengineV1SearchRequest extends \Google\Collection
291291
protected $relevanceScoreSpecType = GoogleCloudDiscoveryengineV1SearchRequestRelevanceScoreSpec::class;
292292
protected $relevanceScoreSpecDataType = '';
293293
/**
294-
* The relevance threshold of the search results. Default to Google defined
295-
* threshold, leveraging a balance of precision and recall to deliver both
296-
* highly accurate results and comprehensive coverage of relevant information.
297-
* This feature is not supported for healthcare search.
294+
* The global relevance threshold of the search results. Defaults to Google
295+
* defined threshold, leveraging a balance of precision and recall to deliver
296+
* both highly accurate results and comprehensive coverage of relevant
297+
* information. If more granular relevance filtering is required, use the
298+
* `relevance_filter_spec` instead. This feature is not supported for
299+
* healthcare search.
298300
*
299301
* @var string
300302
*/
@@ -889,10 +891,12 @@ public function getRelevanceScoreSpec()
889891
return $this->relevanceScoreSpec;
890892
}
891893
/**
892-
* The relevance threshold of the search results. Default to Google defined
893-
* threshold, leveraging a balance of precision and recall to deliver both
894-
* highly accurate results and comprehensive coverage of relevant information.
895-
* This feature is not supported for healthcare search.
894+
* The global relevance threshold of the search results. Defaults to Google
895+
* defined threshold, leveraging a balance of precision and recall to deliver
896+
* both highly accurate results and comprehensive coverage of relevant
897+
* information. If more granular relevance filtering is required, use the
898+
* `relevance_filter_spec` instead. This feature is not supported for
899+
* healthcare search.
896900
*
897901
* Accepted values: RELEVANCE_THRESHOLD_UNSPECIFIED, LOWEST, LOW, MEDIUM, HIGH
898902
*

src/DiscoveryEngine/GoogleCloudDiscoveryengineV1alphaSearchRequest.php

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,17 @@ class GoogleCloudDiscoveryengineV1alphaSearchRequest extends \Google\Collection
303303
* @var string
304304
*/
305305
public $regionCode;
306+
protected $relevanceFilterSpecType = GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec::class;
307+
protected $relevanceFilterSpecDataType = '';
306308
protected $relevanceScoreSpecType = GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceScoreSpec::class;
307309
protected $relevanceScoreSpecDataType = '';
308310
/**
309-
* The relevance threshold of the search results. Default to Google defined
310-
* threshold, leveraging a balance of precision and recall to deliver both
311-
* highly accurate results and comprehensive coverage of relevant information.
312-
* This feature is not supported for healthcare search.
311+
* The global relevance threshold of the search results. Defaults to Google
312+
* defined threshold, leveraging a balance of precision and recall to deliver
313+
* both highly accurate results and comprehensive coverage of relevant
314+
* information. If more granular relevance filtering is required, use the
315+
* `relevance_filter_spec` instead. This feature is not supported for
316+
* healthcare search.
313317
*
314318
* @var string
315319
*/
@@ -986,6 +990,26 @@ public function getRegionCode()
986990
{
987991
return $this->regionCode;
988992
}
993+
/**
994+
* Optional. The granular relevance filtering specification. If not specified,
995+
* the global `relevance_threshold` will be used for all sub-searches. If
996+
* specified, this overrides the global `relevance_threshold` to use
997+
* thresholds on a per sub-search basis. This feature is currently supported
998+
* only for custom and site search.
999+
*
1000+
* @param GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec $relevanceFilterSpec
1001+
*/
1002+
public function setRelevanceFilterSpec(GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec $relevanceFilterSpec)
1003+
{
1004+
$this->relevanceFilterSpec = $relevanceFilterSpec;
1005+
}
1006+
/**
1007+
* @return GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec
1008+
*/
1009+
public function getRelevanceFilterSpec()
1010+
{
1011+
return $this->relevanceFilterSpec;
1012+
}
9891013
/**
9901014
* Optional. The specification for returning the relevance score.
9911015
*
@@ -1003,10 +1027,12 @@ public function getRelevanceScoreSpec()
10031027
return $this->relevanceScoreSpec;
10041028
}
10051029
/**
1006-
* The relevance threshold of the search results. Default to Google defined
1007-
* threshold, leveraging a balance of precision and recall to deliver both
1008-
* highly accurate results and comprehensive coverage of relevant information.
1009-
* This feature is not supported for healthcare search.
1030+
* The global relevance threshold of the search results. Defaults to Google
1031+
* defined threshold, leveraging a balance of precision and recall to deliver
1032+
* both highly accurate results and comprehensive coverage of relevant
1033+
* information. If more granular relevance filtering is required, use the
1034+
* `relevance_filter_spec` instead. This feature is not supported for
1035+
* healthcare search.
10101036
*
10111037
* Accepted values: RELEVANCE_THRESHOLD_UNSPECIFIED, LOWEST, LOW, MEDIUM, HIGH
10121038
*
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DiscoveryEngine;
19+
20+
class GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec extends \Google\Model
21+
{
22+
protected $keywordSearchThresholdType = GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec::class;
23+
protected $keywordSearchThresholdDataType = '';
24+
protected $semanticSearchThresholdType = GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec::class;
25+
protected $semanticSearchThresholdDataType = '';
26+
27+
/**
28+
* Optional. Relevance filtering threshold specification for keyword search.
29+
*
30+
* @param GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $keywordSearchThreshold
31+
*/
32+
public function setKeywordSearchThreshold(GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $keywordSearchThreshold)
33+
{
34+
$this->keywordSearchThreshold = $keywordSearchThreshold;
35+
}
36+
/**
37+
* @return GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec
38+
*/
39+
public function getKeywordSearchThreshold()
40+
{
41+
return $this->keywordSearchThreshold;
42+
}
43+
/**
44+
* Optional. Relevance filtering threshold specification for semantic search.
45+
*
46+
* @param GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $semanticSearchThreshold
47+
*/
48+
public function setSemanticSearchThreshold(GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $semanticSearchThreshold)
49+
{
50+
$this->semanticSearchThreshold = $semanticSearchThreshold;
51+
}
52+
/**
53+
* @return GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec
54+
*/
55+
public function getSemanticSearchThreshold()
56+
{
57+
return $this->semanticSearchThreshold;
58+
}
59+
}
60+
61+
// Adding a class alias for backwards compatibility with the previous class name.
62+
class_alias(GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec::class, 'Google_Service_DiscoveryEngine_GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpec');
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DiscoveryEngine;
19+
20+
class GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec extends \Google\Model
21+
{
22+
/**
23+
* Default value. In this case, server behavior defaults to Google defined
24+
* threshold.
25+
*/
26+
public const RELEVANCE_THRESHOLD_RELEVANCE_THRESHOLD_UNSPECIFIED = 'RELEVANCE_THRESHOLD_UNSPECIFIED';
27+
/**
28+
* Lowest relevance threshold.
29+
*/
30+
public const RELEVANCE_THRESHOLD_LOWEST = 'LOWEST';
31+
/**
32+
* Low relevance threshold.
33+
*/
34+
public const RELEVANCE_THRESHOLD_LOW = 'LOW';
35+
/**
36+
* Medium relevance threshold.
37+
*/
38+
public const RELEVANCE_THRESHOLD_MEDIUM = 'MEDIUM';
39+
/**
40+
* High relevance threshold.
41+
*/
42+
public const RELEVANCE_THRESHOLD_HIGH = 'HIGH';
43+
/**
44+
* Pre-defined relevance threshold for the sub-search.
45+
*
46+
* @var string
47+
*/
48+
public $relevanceThreshold;
49+
/**
50+
* Custom relevance threshold for the sub-search. The value must be in [0.0,
51+
* 1.0].
52+
*
53+
* @var float
54+
*/
55+
public $semanticRelevanceThreshold;
56+
57+
/**
58+
* Pre-defined relevance threshold for the sub-search.
59+
*
60+
* Accepted values: RELEVANCE_THRESHOLD_UNSPECIFIED, LOWEST, LOW, MEDIUM, HIGH
61+
*
62+
* @param self::RELEVANCE_THRESHOLD_* $relevanceThreshold
63+
*/
64+
public function setRelevanceThreshold($relevanceThreshold)
65+
{
66+
$this->relevanceThreshold = $relevanceThreshold;
67+
}
68+
/**
69+
* @return self::RELEVANCE_THRESHOLD_*
70+
*/
71+
public function getRelevanceThreshold()
72+
{
73+
return $this->relevanceThreshold;
74+
}
75+
/**
76+
* Custom relevance threshold for the sub-search. The value must be in [0.0,
77+
* 1.0].
78+
*
79+
* @param float $semanticRelevanceThreshold
80+
*/
81+
public function setSemanticRelevanceThreshold($semanticRelevanceThreshold)
82+
{
83+
$this->semanticRelevanceThreshold = $semanticRelevanceThreshold;
84+
}
85+
/**
86+
* @return float
87+
*/
88+
public function getSemanticRelevanceThreshold()
89+
{
90+
return $this->semanticRelevanceThreshold;
91+
}
92+
}
93+
94+
// Adding a class alias for backwards compatibility with the previous class name.
95+
class_alias(GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec::class, 'Google_Service_DiscoveryEngine_GoogleCloudDiscoveryengineV1alphaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec');

src/DiscoveryEngine/GoogleCloudDiscoveryengineV1betaSearchRequest.php

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,17 @@ class GoogleCloudDiscoveryengineV1betaSearchRequest extends \Google\Collection
301301
* @var string
302302
*/
303303
public $regionCode;
304+
protected $relevanceFilterSpecType = GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec::class;
305+
protected $relevanceFilterSpecDataType = '';
304306
protected $relevanceScoreSpecType = GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceScoreSpec::class;
305307
protected $relevanceScoreSpecDataType = '';
306308
/**
307-
* The relevance threshold of the search results. Default to Google defined
308-
* threshold, leveraging a balance of precision and recall to deliver both
309-
* highly accurate results and comprehensive coverage of relevant information.
310-
* This feature is not supported for healthcare search.
309+
* The global relevance threshold of the search results. Defaults to Google
310+
* defined threshold, leveraging a balance of precision and recall to deliver
311+
* both highly accurate results and comprehensive coverage of relevant
312+
* information. If more granular relevance filtering is required, use the
313+
* `relevance_filter_spec` instead. This feature is not supported for
314+
* healthcare search.
311315
*
312316
* @var string
313317
*/
@@ -958,6 +962,26 @@ public function getRegionCode()
958962
{
959963
return $this->regionCode;
960964
}
965+
/**
966+
* Optional. The granular relevance filtering specification. If not specified,
967+
* the global `relevance_threshold` will be used for all sub-searches. If
968+
* specified, this overrides the global `relevance_threshold` to use
969+
* thresholds on a per sub-search basis. This feature is currently supported
970+
* only for custom and site search.
971+
*
972+
* @param GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec $relevanceFilterSpec
973+
*/
974+
public function setRelevanceFilterSpec(GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec $relevanceFilterSpec)
975+
{
976+
$this->relevanceFilterSpec = $relevanceFilterSpec;
977+
}
978+
/**
979+
* @return GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec
980+
*/
981+
public function getRelevanceFilterSpec()
982+
{
983+
return $this->relevanceFilterSpec;
984+
}
961985
/**
962986
* Optional. The specification for returning the relevance score.
963987
*
@@ -975,10 +999,12 @@ public function getRelevanceScoreSpec()
975999
return $this->relevanceScoreSpec;
9761000
}
9771001
/**
978-
* The relevance threshold of the search results. Default to Google defined
979-
* threshold, leveraging a balance of precision and recall to deliver both
980-
* highly accurate results and comprehensive coverage of relevant information.
981-
* This feature is not supported for healthcare search.
1002+
* The global relevance threshold of the search results. Defaults to Google
1003+
* defined threshold, leveraging a balance of precision and recall to deliver
1004+
* both highly accurate results and comprehensive coverage of relevant
1005+
* information. If more granular relevance filtering is required, use the
1006+
* `relevance_filter_spec` instead. This feature is not supported for
1007+
* healthcare search.
9821008
*
9831009
* Accepted values: RELEVANCE_THRESHOLD_UNSPECIFIED, LOWEST, LOW, MEDIUM, HIGH
9841010
*
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\DiscoveryEngine;
19+
20+
class GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec extends \Google\Model
21+
{
22+
protected $keywordSearchThresholdType = GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec::class;
23+
protected $keywordSearchThresholdDataType = '';
24+
protected $semanticSearchThresholdType = GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec::class;
25+
protected $semanticSearchThresholdDataType = '';
26+
27+
/**
28+
* Optional. Relevance filtering threshold specification for keyword search.
29+
*
30+
* @param GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $keywordSearchThreshold
31+
*/
32+
public function setKeywordSearchThreshold(GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $keywordSearchThreshold)
33+
{
34+
$this->keywordSearchThreshold = $keywordSearchThreshold;
35+
}
36+
/**
37+
* @return GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec
38+
*/
39+
public function getKeywordSearchThreshold()
40+
{
41+
return $this->keywordSearchThreshold;
42+
}
43+
/**
44+
* Optional. Relevance filtering threshold specification for semantic search.
45+
*
46+
* @param GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $semanticSearchThreshold
47+
*/
48+
public function setSemanticSearchThreshold(GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec $semanticSearchThreshold)
49+
{
50+
$this->semanticSearchThreshold = $semanticSearchThreshold;
51+
}
52+
/**
53+
* @return GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpecRelevanceThresholdSpec
54+
*/
55+
public function getSemanticSearchThreshold()
56+
{
57+
return $this->semanticSearchThreshold;
58+
}
59+
}
60+
61+
// Adding a class alias for backwards compatibility with the previous class name.
62+
class_alias(GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec::class, 'Google_Service_DiscoveryEngine_GoogleCloudDiscoveryengineV1betaSearchRequestRelevanceFilterSpec');

0 commit comments

Comments
 (0)