@google-cloud/discoveryengine 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +152 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +128 -4
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +128 -4
- package/build/protos/protos.d.ts +825 -0
- package/build/protos/protos.js +2438 -0
- package/build/protos/protos.json +517 -0
- package/build/src/v1/identity_mapping_store_service_client.js +5 -5
- package/build/src/v1/search_service_client.d.ts +558 -0
- package/build/src/v1/search_service_client.js +372 -0
- package/build/src/v1alpha/search_service_client.d.ts +210 -12
- package/build/src/v1alpha/search_service_client.js +140 -8
- package/build/src/v1beta/search_service_client.d.ts +420 -24
- package/build/src/v1beta/search_service_client.js +280 -16
- package/package.json +1 -1
package/build/protos/protos.js
CHANGED
@@ -12649,6 +12649,8 @@
|
|
12649
12649
|
* @property {google.cloud.discoveryengine.v1.SearchRequest.ISessionSpec|null} [sessionSpec] SearchRequest sessionSpec
|
12650
12650
|
* @property {google.cloud.discoveryengine.v1.SearchRequest.RelevanceThreshold|null} [relevanceThreshold] SearchRequest relevanceThreshold
|
12651
12651
|
* @property {google.cloud.discoveryengine.v1.SearchRequest.IRelevanceScoreSpec|null} [relevanceScoreSpec] SearchRequest relevanceScoreSpec
|
12652
|
+
* @property {string|null} [rankingExpression] SearchRequest rankingExpression
|
12653
|
+
* @property {google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend|null} [rankingExpressionBackend] SearchRequest rankingExpressionBackend
|
12652
12654
|
*/
|
12653
12655
|
|
12654
12656
|
/**
|
@@ -12902,6 +12904,22 @@
|
|
12902
12904
|
*/
|
12903
12905
|
SearchRequest.prototype.relevanceScoreSpec = null;
|
12904
12906
|
|
12907
|
+
/**
|
12908
|
+
* SearchRequest rankingExpression.
|
12909
|
+
* @member {string} rankingExpression
|
12910
|
+
* @memberof google.cloud.discoveryengine.v1.SearchRequest
|
12911
|
+
* @instance
|
12912
|
+
*/
|
12913
|
+
SearchRequest.prototype.rankingExpression = "";
|
12914
|
+
|
12915
|
+
/**
|
12916
|
+
* SearchRequest rankingExpressionBackend.
|
12917
|
+
* @member {google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend} rankingExpressionBackend
|
12918
|
+
* @memberof google.cloud.discoveryengine.v1.SearchRequest
|
12919
|
+
* @instance
|
12920
|
+
*/
|
12921
|
+
SearchRequest.prototype.rankingExpressionBackend = 0;
|
12922
|
+
|
12905
12923
|
/**
|
12906
12924
|
* Creates a new SearchRequest instance using the specified properties.
|
12907
12925
|
* @function create
|
@@ -12969,6 +12987,8 @@
|
|
12969
12987
|
writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.userLabels[keys[i]]).ldelim();
|
12970
12988
|
if (message.contentSearchSpec != null && Object.hasOwnProperty.call(message, "contentSearchSpec"))
|
12971
12989
|
$root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.encode(message.contentSearchSpec, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim();
|
12990
|
+
if (message.rankingExpression != null && Object.hasOwnProperty.call(message, "rankingExpression"))
|
12991
|
+
writer.uint32(/* id 26, wireType 2 =*/210).string(message.rankingExpression);
|
12972
12992
|
if (message.canonicalFilter != null && Object.hasOwnProperty.call(message, "canonicalFilter"))
|
12973
12993
|
writer.uint32(/* id 29, wireType 2 =*/234).string(message.canonicalFilter);
|
12974
12994
|
if (message.searchAsYouTypeSpec != null && Object.hasOwnProperty.call(message, "searchAsYouTypeSpec"))
|
@@ -12990,6 +13010,8 @@
|
|
12990
13010
|
writer.uint32(/* id 47, wireType 0 =*/376).int32(message.oneBoxPageSize);
|
12991
13011
|
if (message.relevanceScoreSpec != null && Object.hasOwnProperty.call(message, "relevanceScoreSpec"))
|
12992
13012
|
$root.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec.encode(message.relevanceScoreSpec, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim();
|
13013
|
+
if (message.rankingExpressionBackend != null && Object.hasOwnProperty.call(message, "rankingExpressionBackend"))
|
13014
|
+
writer.uint32(/* id 53, wireType 0 =*/424).int32(message.rankingExpressionBackend);
|
12993
13015
|
return writer;
|
12994
13016
|
};
|
12995
13017
|
|
@@ -13184,6 +13206,14 @@
|
|
13184
13206
|
message.relevanceScoreSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec.decode(reader, reader.uint32());
|
13185
13207
|
break;
|
13186
13208
|
}
|
13209
|
+
case 26: {
|
13210
|
+
message.rankingExpression = reader.string();
|
13211
|
+
break;
|
13212
|
+
}
|
13213
|
+
case 53: {
|
13214
|
+
message.rankingExpressionBackend = reader.int32();
|
13215
|
+
break;
|
13216
|
+
}
|
13187
13217
|
default:
|
13188
13218
|
reader.skipType(tag & 7);
|
13189
13219
|
break;
|
@@ -13358,6 +13388,18 @@
|
|
13358
13388
|
if (error)
|
13359
13389
|
return "relevanceScoreSpec." + error;
|
13360
13390
|
}
|
13391
|
+
if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression"))
|
13392
|
+
if (!$util.isString(message.rankingExpression))
|
13393
|
+
return "rankingExpression: string expected";
|
13394
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
13395
|
+
switch (message.rankingExpressionBackend) {
|
13396
|
+
default:
|
13397
|
+
return "rankingExpressionBackend: enum value expected";
|
13398
|
+
case 0:
|
13399
|
+
case 3:
|
13400
|
+
case 4:
|
13401
|
+
break;
|
13402
|
+
}
|
13361
13403
|
return null;
|
13362
13404
|
};
|
13363
13405
|
|
@@ -13516,6 +13558,28 @@
|
|
13516
13558
|
throw TypeError(".google.cloud.discoveryengine.v1.SearchRequest.relevanceScoreSpec: object expected");
|
13517
13559
|
message.relevanceScoreSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec.fromObject(object.relevanceScoreSpec);
|
13518
13560
|
}
|
13561
|
+
if (object.rankingExpression != null)
|
13562
|
+
message.rankingExpression = String(object.rankingExpression);
|
13563
|
+
switch (object.rankingExpressionBackend) {
|
13564
|
+
default:
|
13565
|
+
if (typeof object.rankingExpressionBackend === "number") {
|
13566
|
+
message.rankingExpressionBackend = object.rankingExpressionBackend;
|
13567
|
+
break;
|
13568
|
+
}
|
13569
|
+
break;
|
13570
|
+
case "RANKING_EXPRESSION_BACKEND_UNSPECIFIED":
|
13571
|
+
case 0:
|
13572
|
+
message.rankingExpressionBackend = 0;
|
13573
|
+
break;
|
13574
|
+
case "RANK_BY_EMBEDDING":
|
13575
|
+
case 3:
|
13576
|
+
message.rankingExpressionBackend = 3;
|
13577
|
+
break;
|
13578
|
+
case "RANK_BY_FORMULA":
|
13579
|
+
case 4:
|
13580
|
+
message.rankingExpressionBackend = 4;
|
13581
|
+
break;
|
13582
|
+
}
|
13519
13583
|
return message;
|
13520
13584
|
};
|
13521
13585
|
|
@@ -13557,6 +13621,7 @@
|
|
13557
13621
|
object.safeSearch = false;
|
13558
13622
|
object.userInfo = null;
|
13559
13623
|
object.contentSearchSpec = null;
|
13624
|
+
object.rankingExpression = "";
|
13560
13625
|
object.canonicalFilter = "";
|
13561
13626
|
object.searchAsYouTypeSpec = null;
|
13562
13627
|
object.languageCode = "";
|
@@ -13566,6 +13631,7 @@
|
|
13566
13631
|
object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0;
|
13567
13632
|
object.oneBoxPageSize = 0;
|
13568
13633
|
object.relevanceScoreSpec = null;
|
13634
|
+
object.rankingExpressionBackend = options.enums === String ? "RANKING_EXPRESSION_BACKEND_UNSPECIFIED" : 0;
|
13569
13635
|
}
|
13570
13636
|
if (message.servingConfig != null && message.hasOwnProperty("servingConfig"))
|
13571
13637
|
object.servingConfig = message.servingConfig;
|
@@ -13615,6 +13681,8 @@
|
|
13615
13681
|
}
|
13616
13682
|
if (message.contentSearchSpec != null && message.hasOwnProperty("contentSearchSpec"))
|
13617
13683
|
object.contentSearchSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.toObject(message.contentSearchSpec, options);
|
13684
|
+
if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression"))
|
13685
|
+
object.rankingExpression = message.rankingExpression;
|
13618
13686
|
if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter"))
|
13619
13687
|
object.canonicalFilter = message.canonicalFilter;
|
13620
13688
|
if (message.searchAsYouTypeSpec != null && message.hasOwnProperty("searchAsYouTypeSpec"))
|
@@ -13638,6 +13706,8 @@
|
|
13638
13706
|
object.oneBoxPageSize = message.oneBoxPageSize;
|
13639
13707
|
if (message.relevanceScoreSpec != null && message.hasOwnProperty("relevanceScoreSpec"))
|
13640
13708
|
object.relevanceScoreSpec = $root.google.cloud.discoveryengine.v1.SearchRequest.RelevanceScoreSpec.toObject(message.relevanceScoreSpec, options);
|
13709
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
13710
|
+
object.rankingExpressionBackend = options.enums === String ? $root.google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] === undefined ? message.rankingExpressionBackend : $root.google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] : message.rankingExpressionBackend;
|
13641
13711
|
return object;
|
13642
13712
|
};
|
13643
13713
|
|
@@ -19412,6 +19482,22 @@
|
|
19412
19482
|
return values;
|
19413
19483
|
})();
|
19414
19484
|
|
19485
|
+
/**
|
19486
|
+
* RankingExpressionBackend enum.
|
19487
|
+
* @name google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend
|
19488
|
+
* @enum {number}
|
19489
|
+
* @property {number} RANKING_EXPRESSION_BACKEND_UNSPECIFIED=0 RANKING_EXPRESSION_BACKEND_UNSPECIFIED value
|
19490
|
+
* @property {number} RANK_BY_EMBEDDING=3 RANK_BY_EMBEDDING value
|
19491
|
+
* @property {number} RANK_BY_FORMULA=4 RANK_BY_FORMULA value
|
19492
|
+
*/
|
19493
|
+
SearchRequest.RankingExpressionBackend = (function() {
|
19494
|
+
var valuesById = {}, values = Object.create(valuesById);
|
19495
|
+
values[valuesById[0] = "RANKING_EXPRESSION_BACKEND_UNSPECIFIED"] = 0;
|
19496
|
+
values[valuesById[3] = "RANK_BY_EMBEDDING"] = 3;
|
19497
|
+
values[valuesById[4] = "RANK_BY_FORMULA"] = 4;
|
19498
|
+
return values;
|
19499
|
+
})();
|
19500
|
+
|
19415
19501
|
return SearchRequest;
|
19416
19502
|
})();
|
19417
19503
|
|
@@ -19938,6 +20024,7 @@
|
|
19938
20024
|
* @property {google.cloud.discoveryengine.v1.IDocument|null} [document] SearchResult document
|
19939
20025
|
* @property {google.cloud.discoveryengine.v1.IChunk|null} [chunk] SearchResult chunk
|
19940
20026
|
* @property {Object.<string,google.cloud.discoveryengine.v1.IDoubleList>|null} [modelScores] SearchResult modelScores
|
20027
|
+
* @property {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals|null} [rankSignals] SearchResult rankSignals
|
19941
20028
|
*/
|
19942
20029
|
|
19943
20030
|
/**
|
@@ -19988,6 +20075,14 @@
|
|
19988
20075
|
*/
|
19989
20076
|
SearchResult.prototype.modelScores = $util.emptyObject;
|
19990
20077
|
|
20078
|
+
/**
|
20079
|
+
* SearchResult rankSignals.
|
20080
|
+
* @member {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals|null|undefined} rankSignals
|
20081
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult
|
20082
|
+
* @instance
|
20083
|
+
*/
|
20084
|
+
SearchResult.prototype.rankSignals = null;
|
20085
|
+
|
19991
20086
|
/**
|
19992
20087
|
* Creates a new SearchResult instance using the specified properties.
|
19993
20088
|
* @function create
|
@@ -20021,6 +20116,8 @@
|
|
20021
20116
|
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
|
20022
20117
|
$root.google.cloud.discoveryengine.v1.DoubleList.encode(message.modelScores[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
|
20023
20118
|
}
|
20119
|
+
if (message.rankSignals != null && Object.hasOwnProperty.call(message, "rankSignals"))
|
20120
|
+
$root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.encode(message.rankSignals, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
20024
20121
|
if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
|
20025
20122
|
$root.google.cloud.discoveryengine.v1.Chunk.encode(message.chunk, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
|
20026
20123
|
return writer;
|
@@ -20094,6 +20191,10 @@
|
|
20094
20191
|
message.modelScores[key] = value;
|
20095
20192
|
break;
|
20096
20193
|
}
|
20194
|
+
case 7: {
|
20195
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.decode(reader, reader.uint32());
|
20196
|
+
break;
|
20197
|
+
}
|
20097
20198
|
default:
|
20098
20199
|
reader.skipType(tag & 7);
|
20099
20200
|
break;
|
@@ -20152,6 +20253,11 @@
|
|
20152
20253
|
return "modelScores." + error;
|
20153
20254
|
}
|
20154
20255
|
}
|
20256
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals")) {
|
20257
|
+
var error = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.verify(message.rankSignals);
|
20258
|
+
if (error)
|
20259
|
+
return "rankSignals." + error;
|
20260
|
+
}
|
20155
20261
|
return null;
|
20156
20262
|
};
|
20157
20263
|
|
@@ -20189,6 +20295,11 @@
|
|
20189
20295
|
message.modelScores[keys[i]] = $root.google.cloud.discoveryengine.v1.DoubleList.fromObject(object.modelScores[keys[i]]);
|
20190
20296
|
}
|
20191
20297
|
}
|
20298
|
+
if (object.rankSignals != null) {
|
20299
|
+
if (typeof object.rankSignals !== "object")
|
20300
|
+
throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.SearchResult.rankSignals: object expected");
|
20301
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.fromObject(object.rankSignals);
|
20302
|
+
}
|
20192
20303
|
return message;
|
20193
20304
|
};
|
20194
20305
|
|
@@ -20210,6 +20321,7 @@
|
|
20210
20321
|
if (options.defaults) {
|
20211
20322
|
object.id = "";
|
20212
20323
|
object.document = null;
|
20324
|
+
object.rankSignals = null;
|
20213
20325
|
object.chunk = null;
|
20214
20326
|
}
|
20215
20327
|
if (message.id != null && message.hasOwnProperty("id"))
|
@@ -20222,6 +20334,8 @@
|
|
20222
20334
|
for (var j = 0; j < keys2.length; ++j)
|
20223
20335
|
object.modelScores[keys2[j]] = $root.google.cloud.discoveryengine.v1.DoubleList.toObject(message.modelScores[keys2[j]], options);
|
20224
20336
|
}
|
20337
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals"))
|
20338
|
+
object.rankSignals = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.toObject(message.rankSignals, options);
|
20225
20339
|
if (message.chunk != null && message.hasOwnProperty("chunk"))
|
20226
20340
|
object.chunk = $root.google.cloud.discoveryengine.v1.Chunk.toObject(message.chunk, options);
|
20227
20341
|
return object;
|
@@ -20253,6 +20367,720 @@
|
|
20253
20367
|
return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchResponse.SearchResult";
|
20254
20368
|
};
|
20255
20369
|
|
20370
|
+
SearchResult.RankSignals = (function() {
|
20371
|
+
|
20372
|
+
/**
|
20373
|
+
* Properties of a RankSignals.
|
20374
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult
|
20375
|
+
* @interface IRankSignals
|
20376
|
+
* @property {number|null} [keywordSimilarityScore] RankSignals keywordSimilarityScore
|
20377
|
+
* @property {number|null} [relevanceScore] RankSignals relevanceScore
|
20378
|
+
* @property {number|null} [semanticSimilarityScore] RankSignals semanticSimilarityScore
|
20379
|
+
* @property {number|null} [pctrRank] RankSignals pctrRank
|
20380
|
+
* @property {number|null} [topicalityRank] RankSignals topicalityRank
|
20381
|
+
* @property {number|null} [documentAge] RankSignals documentAge
|
20382
|
+
* @property {number|null} [boostingFactor] RankSignals boostingFactor
|
20383
|
+
* @property {number|null} [defaultRank] RankSignals defaultRank
|
20384
|
+
* @property {Array.<google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal>|null} [customSignals] RankSignals customSignals
|
20385
|
+
*/
|
20386
|
+
|
20387
|
+
/**
|
20388
|
+
* Constructs a new RankSignals.
|
20389
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult
|
20390
|
+
* @classdesc Represents a RankSignals.
|
20391
|
+
* @implements IRankSignals
|
20392
|
+
* @constructor
|
20393
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
20394
|
+
*/
|
20395
|
+
function RankSignals(properties) {
|
20396
|
+
this.customSignals = [];
|
20397
|
+
if (properties)
|
20398
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20399
|
+
if (properties[keys[i]] != null)
|
20400
|
+
this[keys[i]] = properties[keys[i]];
|
20401
|
+
}
|
20402
|
+
|
20403
|
+
/**
|
20404
|
+
* RankSignals keywordSimilarityScore.
|
20405
|
+
* @member {number|null|undefined} keywordSimilarityScore
|
20406
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20407
|
+
* @instance
|
20408
|
+
*/
|
20409
|
+
RankSignals.prototype.keywordSimilarityScore = null;
|
20410
|
+
|
20411
|
+
/**
|
20412
|
+
* RankSignals relevanceScore.
|
20413
|
+
* @member {number|null|undefined} relevanceScore
|
20414
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20415
|
+
* @instance
|
20416
|
+
*/
|
20417
|
+
RankSignals.prototype.relevanceScore = null;
|
20418
|
+
|
20419
|
+
/**
|
20420
|
+
* RankSignals semanticSimilarityScore.
|
20421
|
+
* @member {number|null|undefined} semanticSimilarityScore
|
20422
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20423
|
+
* @instance
|
20424
|
+
*/
|
20425
|
+
RankSignals.prototype.semanticSimilarityScore = null;
|
20426
|
+
|
20427
|
+
/**
|
20428
|
+
* RankSignals pctrRank.
|
20429
|
+
* @member {number|null|undefined} pctrRank
|
20430
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20431
|
+
* @instance
|
20432
|
+
*/
|
20433
|
+
RankSignals.prototype.pctrRank = null;
|
20434
|
+
|
20435
|
+
/**
|
20436
|
+
* RankSignals topicalityRank.
|
20437
|
+
* @member {number|null|undefined} topicalityRank
|
20438
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20439
|
+
* @instance
|
20440
|
+
*/
|
20441
|
+
RankSignals.prototype.topicalityRank = null;
|
20442
|
+
|
20443
|
+
/**
|
20444
|
+
* RankSignals documentAge.
|
20445
|
+
* @member {number|null|undefined} documentAge
|
20446
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20447
|
+
* @instance
|
20448
|
+
*/
|
20449
|
+
RankSignals.prototype.documentAge = null;
|
20450
|
+
|
20451
|
+
/**
|
20452
|
+
* RankSignals boostingFactor.
|
20453
|
+
* @member {number|null|undefined} boostingFactor
|
20454
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20455
|
+
* @instance
|
20456
|
+
*/
|
20457
|
+
RankSignals.prototype.boostingFactor = null;
|
20458
|
+
|
20459
|
+
/**
|
20460
|
+
* RankSignals defaultRank.
|
20461
|
+
* @member {number} defaultRank
|
20462
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20463
|
+
* @instance
|
20464
|
+
*/
|
20465
|
+
RankSignals.prototype.defaultRank = 0;
|
20466
|
+
|
20467
|
+
/**
|
20468
|
+
* RankSignals customSignals.
|
20469
|
+
* @member {Array.<google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal>} customSignals
|
20470
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20471
|
+
* @instance
|
20472
|
+
*/
|
20473
|
+
RankSignals.prototype.customSignals = $util.emptyArray;
|
20474
|
+
|
20475
|
+
// OneOf field names bound to virtual getters and setters
|
20476
|
+
var $oneOfFields;
|
20477
|
+
|
20478
|
+
// Virtual OneOf for proto3 optional field
|
20479
|
+
Object.defineProperty(RankSignals.prototype, "_keywordSimilarityScore", {
|
20480
|
+
get: $util.oneOfGetter($oneOfFields = ["keywordSimilarityScore"]),
|
20481
|
+
set: $util.oneOfSetter($oneOfFields)
|
20482
|
+
});
|
20483
|
+
|
20484
|
+
// Virtual OneOf for proto3 optional field
|
20485
|
+
Object.defineProperty(RankSignals.prototype, "_relevanceScore", {
|
20486
|
+
get: $util.oneOfGetter($oneOfFields = ["relevanceScore"]),
|
20487
|
+
set: $util.oneOfSetter($oneOfFields)
|
20488
|
+
});
|
20489
|
+
|
20490
|
+
// Virtual OneOf for proto3 optional field
|
20491
|
+
Object.defineProperty(RankSignals.prototype, "_semanticSimilarityScore", {
|
20492
|
+
get: $util.oneOfGetter($oneOfFields = ["semanticSimilarityScore"]),
|
20493
|
+
set: $util.oneOfSetter($oneOfFields)
|
20494
|
+
});
|
20495
|
+
|
20496
|
+
// Virtual OneOf for proto3 optional field
|
20497
|
+
Object.defineProperty(RankSignals.prototype, "_pctrRank", {
|
20498
|
+
get: $util.oneOfGetter($oneOfFields = ["pctrRank"]),
|
20499
|
+
set: $util.oneOfSetter($oneOfFields)
|
20500
|
+
});
|
20501
|
+
|
20502
|
+
// Virtual OneOf for proto3 optional field
|
20503
|
+
Object.defineProperty(RankSignals.prototype, "_topicalityRank", {
|
20504
|
+
get: $util.oneOfGetter($oneOfFields = ["topicalityRank"]),
|
20505
|
+
set: $util.oneOfSetter($oneOfFields)
|
20506
|
+
});
|
20507
|
+
|
20508
|
+
// Virtual OneOf for proto3 optional field
|
20509
|
+
Object.defineProperty(RankSignals.prototype, "_documentAge", {
|
20510
|
+
get: $util.oneOfGetter($oneOfFields = ["documentAge"]),
|
20511
|
+
set: $util.oneOfSetter($oneOfFields)
|
20512
|
+
});
|
20513
|
+
|
20514
|
+
// Virtual OneOf for proto3 optional field
|
20515
|
+
Object.defineProperty(RankSignals.prototype, "_boostingFactor", {
|
20516
|
+
get: $util.oneOfGetter($oneOfFields = ["boostingFactor"]),
|
20517
|
+
set: $util.oneOfSetter($oneOfFields)
|
20518
|
+
});
|
20519
|
+
|
20520
|
+
/**
|
20521
|
+
* Creates a new RankSignals instance using the specified properties.
|
20522
|
+
* @function create
|
20523
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20524
|
+
* @static
|
20525
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
20526
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals} RankSignals instance
|
20527
|
+
*/
|
20528
|
+
RankSignals.create = function create(properties) {
|
20529
|
+
return new RankSignals(properties);
|
20530
|
+
};
|
20531
|
+
|
20532
|
+
/**
|
20533
|
+
* Encodes the specified RankSignals message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
20534
|
+
* @function encode
|
20535
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20536
|
+
* @static
|
20537
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
20538
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
20539
|
+
* @returns {$protobuf.Writer} Writer
|
20540
|
+
*/
|
20541
|
+
RankSignals.encode = function encode(message, writer) {
|
20542
|
+
if (!writer)
|
20543
|
+
writer = $Writer.create();
|
20544
|
+
if (message.keywordSimilarityScore != null && Object.hasOwnProperty.call(message, "keywordSimilarityScore"))
|
20545
|
+
writer.uint32(/* id 1, wireType 5 =*/13).float(message.keywordSimilarityScore);
|
20546
|
+
if (message.relevanceScore != null && Object.hasOwnProperty.call(message, "relevanceScore"))
|
20547
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.relevanceScore);
|
20548
|
+
if (message.semanticSimilarityScore != null && Object.hasOwnProperty.call(message, "semanticSimilarityScore"))
|
20549
|
+
writer.uint32(/* id 3, wireType 5 =*/29).float(message.semanticSimilarityScore);
|
20550
|
+
if (message.pctrRank != null && Object.hasOwnProperty.call(message, "pctrRank"))
|
20551
|
+
writer.uint32(/* id 4, wireType 5 =*/37).float(message.pctrRank);
|
20552
|
+
if (message.topicalityRank != null && Object.hasOwnProperty.call(message, "topicalityRank"))
|
20553
|
+
writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicalityRank);
|
20554
|
+
if (message.documentAge != null && Object.hasOwnProperty.call(message, "documentAge"))
|
20555
|
+
writer.uint32(/* id 7, wireType 5 =*/61).float(message.documentAge);
|
20556
|
+
if (message.boostingFactor != null && Object.hasOwnProperty.call(message, "boostingFactor"))
|
20557
|
+
writer.uint32(/* id 8, wireType 5 =*/69).float(message.boostingFactor);
|
20558
|
+
if (message.defaultRank != null && Object.hasOwnProperty.call(message, "defaultRank"))
|
20559
|
+
writer.uint32(/* id 32, wireType 5 =*/261).float(message.defaultRank);
|
20560
|
+
if (message.customSignals != null && message.customSignals.length)
|
20561
|
+
for (var i = 0; i < message.customSignals.length; ++i)
|
20562
|
+
$root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.encode(message.customSignals[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim();
|
20563
|
+
return writer;
|
20564
|
+
};
|
20565
|
+
|
20566
|
+
/**
|
20567
|
+
* Encodes the specified RankSignals message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
20568
|
+
* @function encodeDelimited
|
20569
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20570
|
+
* @static
|
20571
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
20572
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
20573
|
+
* @returns {$protobuf.Writer} Writer
|
20574
|
+
*/
|
20575
|
+
RankSignals.encodeDelimited = function encodeDelimited(message, writer) {
|
20576
|
+
return this.encode(message, writer).ldelim();
|
20577
|
+
};
|
20578
|
+
|
20579
|
+
/**
|
20580
|
+
* Decodes a RankSignals message from the specified reader or buffer.
|
20581
|
+
* @function decode
|
20582
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20583
|
+
* @static
|
20584
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20585
|
+
* @param {number} [length] Message length if known beforehand
|
20586
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals} RankSignals
|
20587
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
20588
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20589
|
+
*/
|
20590
|
+
RankSignals.decode = function decode(reader, length, error) {
|
20591
|
+
if (!(reader instanceof $Reader))
|
20592
|
+
reader = $Reader.create(reader);
|
20593
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals();
|
20594
|
+
while (reader.pos < end) {
|
20595
|
+
var tag = reader.uint32();
|
20596
|
+
if (tag === error)
|
20597
|
+
break;
|
20598
|
+
switch (tag >>> 3) {
|
20599
|
+
case 1: {
|
20600
|
+
message.keywordSimilarityScore = reader.float();
|
20601
|
+
break;
|
20602
|
+
}
|
20603
|
+
case 2: {
|
20604
|
+
message.relevanceScore = reader.float();
|
20605
|
+
break;
|
20606
|
+
}
|
20607
|
+
case 3: {
|
20608
|
+
message.semanticSimilarityScore = reader.float();
|
20609
|
+
break;
|
20610
|
+
}
|
20611
|
+
case 4: {
|
20612
|
+
message.pctrRank = reader.float();
|
20613
|
+
break;
|
20614
|
+
}
|
20615
|
+
case 6: {
|
20616
|
+
message.topicalityRank = reader.float();
|
20617
|
+
break;
|
20618
|
+
}
|
20619
|
+
case 7: {
|
20620
|
+
message.documentAge = reader.float();
|
20621
|
+
break;
|
20622
|
+
}
|
20623
|
+
case 8: {
|
20624
|
+
message.boostingFactor = reader.float();
|
20625
|
+
break;
|
20626
|
+
}
|
20627
|
+
case 32: {
|
20628
|
+
message.defaultRank = reader.float();
|
20629
|
+
break;
|
20630
|
+
}
|
20631
|
+
case 33: {
|
20632
|
+
if (!(message.customSignals && message.customSignals.length))
|
20633
|
+
message.customSignals = [];
|
20634
|
+
message.customSignals.push($root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.decode(reader, reader.uint32()));
|
20635
|
+
break;
|
20636
|
+
}
|
20637
|
+
default:
|
20638
|
+
reader.skipType(tag & 7);
|
20639
|
+
break;
|
20640
|
+
}
|
20641
|
+
}
|
20642
|
+
return message;
|
20643
|
+
};
|
20644
|
+
|
20645
|
+
/**
|
20646
|
+
* Decodes a RankSignals message from the specified reader or buffer, length delimited.
|
20647
|
+
* @function decodeDelimited
|
20648
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20649
|
+
* @static
|
20650
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20651
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals} RankSignals
|
20652
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
20653
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20654
|
+
*/
|
20655
|
+
RankSignals.decodeDelimited = function decodeDelimited(reader) {
|
20656
|
+
if (!(reader instanceof $Reader))
|
20657
|
+
reader = new $Reader(reader);
|
20658
|
+
return this.decode(reader, reader.uint32());
|
20659
|
+
};
|
20660
|
+
|
20661
|
+
/**
|
20662
|
+
* Verifies a RankSignals message.
|
20663
|
+
* @function verify
|
20664
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20665
|
+
* @static
|
20666
|
+
* @param {Object.<string,*>} message Plain object to verify
|
20667
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20668
|
+
*/
|
20669
|
+
RankSignals.verify = function verify(message) {
|
20670
|
+
if (typeof message !== "object" || message === null)
|
20671
|
+
return "object expected";
|
20672
|
+
var properties = {};
|
20673
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
20674
|
+
properties._keywordSimilarityScore = 1;
|
20675
|
+
if (typeof message.keywordSimilarityScore !== "number")
|
20676
|
+
return "keywordSimilarityScore: number expected";
|
20677
|
+
}
|
20678
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
20679
|
+
properties._relevanceScore = 1;
|
20680
|
+
if (typeof message.relevanceScore !== "number")
|
20681
|
+
return "relevanceScore: number expected";
|
20682
|
+
}
|
20683
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
20684
|
+
properties._semanticSimilarityScore = 1;
|
20685
|
+
if (typeof message.semanticSimilarityScore !== "number")
|
20686
|
+
return "semanticSimilarityScore: number expected";
|
20687
|
+
}
|
20688
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
20689
|
+
properties._pctrRank = 1;
|
20690
|
+
if (typeof message.pctrRank !== "number")
|
20691
|
+
return "pctrRank: number expected";
|
20692
|
+
}
|
20693
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
20694
|
+
properties._topicalityRank = 1;
|
20695
|
+
if (typeof message.topicalityRank !== "number")
|
20696
|
+
return "topicalityRank: number expected";
|
20697
|
+
}
|
20698
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
20699
|
+
properties._documentAge = 1;
|
20700
|
+
if (typeof message.documentAge !== "number")
|
20701
|
+
return "documentAge: number expected";
|
20702
|
+
}
|
20703
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
20704
|
+
properties._boostingFactor = 1;
|
20705
|
+
if (typeof message.boostingFactor !== "number")
|
20706
|
+
return "boostingFactor: number expected";
|
20707
|
+
}
|
20708
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
20709
|
+
if (typeof message.defaultRank !== "number")
|
20710
|
+
return "defaultRank: number expected";
|
20711
|
+
if (message.customSignals != null && message.hasOwnProperty("customSignals")) {
|
20712
|
+
if (!Array.isArray(message.customSignals))
|
20713
|
+
return "customSignals: array expected";
|
20714
|
+
for (var i = 0; i < message.customSignals.length; ++i) {
|
20715
|
+
var error = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.verify(message.customSignals[i]);
|
20716
|
+
if (error)
|
20717
|
+
return "customSignals." + error;
|
20718
|
+
}
|
20719
|
+
}
|
20720
|
+
return null;
|
20721
|
+
};
|
20722
|
+
|
20723
|
+
/**
|
20724
|
+
* Creates a RankSignals message from a plain object. Also converts values to their respective internal types.
|
20725
|
+
* @function fromObject
|
20726
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20727
|
+
* @static
|
20728
|
+
* @param {Object.<string,*>} object Plain object
|
20729
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals} RankSignals
|
20730
|
+
*/
|
20731
|
+
RankSignals.fromObject = function fromObject(object) {
|
20732
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals)
|
20733
|
+
return object;
|
20734
|
+
var message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals();
|
20735
|
+
if (object.keywordSimilarityScore != null)
|
20736
|
+
message.keywordSimilarityScore = Number(object.keywordSimilarityScore);
|
20737
|
+
if (object.relevanceScore != null)
|
20738
|
+
message.relevanceScore = Number(object.relevanceScore);
|
20739
|
+
if (object.semanticSimilarityScore != null)
|
20740
|
+
message.semanticSimilarityScore = Number(object.semanticSimilarityScore);
|
20741
|
+
if (object.pctrRank != null)
|
20742
|
+
message.pctrRank = Number(object.pctrRank);
|
20743
|
+
if (object.topicalityRank != null)
|
20744
|
+
message.topicalityRank = Number(object.topicalityRank);
|
20745
|
+
if (object.documentAge != null)
|
20746
|
+
message.documentAge = Number(object.documentAge);
|
20747
|
+
if (object.boostingFactor != null)
|
20748
|
+
message.boostingFactor = Number(object.boostingFactor);
|
20749
|
+
if (object.defaultRank != null)
|
20750
|
+
message.defaultRank = Number(object.defaultRank);
|
20751
|
+
if (object.customSignals) {
|
20752
|
+
if (!Array.isArray(object.customSignals))
|
20753
|
+
throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.customSignals: array expected");
|
20754
|
+
message.customSignals = [];
|
20755
|
+
for (var i = 0; i < object.customSignals.length; ++i) {
|
20756
|
+
if (typeof object.customSignals[i] !== "object")
|
20757
|
+
throw TypeError(".google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.customSignals: object expected");
|
20758
|
+
message.customSignals[i] = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.fromObject(object.customSignals[i]);
|
20759
|
+
}
|
20760
|
+
}
|
20761
|
+
return message;
|
20762
|
+
};
|
20763
|
+
|
20764
|
+
/**
|
20765
|
+
* Creates a plain object from a RankSignals message. Also converts values to other types if specified.
|
20766
|
+
* @function toObject
|
20767
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20768
|
+
* @static
|
20769
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals} message RankSignals
|
20770
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
20771
|
+
* @returns {Object.<string,*>} Plain object
|
20772
|
+
*/
|
20773
|
+
RankSignals.toObject = function toObject(message, options) {
|
20774
|
+
if (!options)
|
20775
|
+
options = {};
|
20776
|
+
var object = {};
|
20777
|
+
if (options.arrays || options.defaults)
|
20778
|
+
object.customSignals = [];
|
20779
|
+
if (options.defaults)
|
20780
|
+
object.defaultRank = 0;
|
20781
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
20782
|
+
object.keywordSimilarityScore = options.json && !isFinite(message.keywordSimilarityScore) ? String(message.keywordSimilarityScore) : message.keywordSimilarityScore;
|
20783
|
+
if (options.oneofs)
|
20784
|
+
object._keywordSimilarityScore = "keywordSimilarityScore";
|
20785
|
+
}
|
20786
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
20787
|
+
object.relevanceScore = options.json && !isFinite(message.relevanceScore) ? String(message.relevanceScore) : message.relevanceScore;
|
20788
|
+
if (options.oneofs)
|
20789
|
+
object._relevanceScore = "relevanceScore";
|
20790
|
+
}
|
20791
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
20792
|
+
object.semanticSimilarityScore = options.json && !isFinite(message.semanticSimilarityScore) ? String(message.semanticSimilarityScore) : message.semanticSimilarityScore;
|
20793
|
+
if (options.oneofs)
|
20794
|
+
object._semanticSimilarityScore = "semanticSimilarityScore";
|
20795
|
+
}
|
20796
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
20797
|
+
object.pctrRank = options.json && !isFinite(message.pctrRank) ? String(message.pctrRank) : message.pctrRank;
|
20798
|
+
if (options.oneofs)
|
20799
|
+
object._pctrRank = "pctrRank";
|
20800
|
+
}
|
20801
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
20802
|
+
object.topicalityRank = options.json && !isFinite(message.topicalityRank) ? String(message.topicalityRank) : message.topicalityRank;
|
20803
|
+
if (options.oneofs)
|
20804
|
+
object._topicalityRank = "topicalityRank";
|
20805
|
+
}
|
20806
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
20807
|
+
object.documentAge = options.json && !isFinite(message.documentAge) ? String(message.documentAge) : message.documentAge;
|
20808
|
+
if (options.oneofs)
|
20809
|
+
object._documentAge = "documentAge";
|
20810
|
+
}
|
20811
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
20812
|
+
object.boostingFactor = options.json && !isFinite(message.boostingFactor) ? String(message.boostingFactor) : message.boostingFactor;
|
20813
|
+
if (options.oneofs)
|
20814
|
+
object._boostingFactor = "boostingFactor";
|
20815
|
+
}
|
20816
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
20817
|
+
object.defaultRank = options.json && !isFinite(message.defaultRank) ? String(message.defaultRank) : message.defaultRank;
|
20818
|
+
if (message.customSignals && message.customSignals.length) {
|
20819
|
+
object.customSignals = [];
|
20820
|
+
for (var j = 0; j < message.customSignals.length; ++j)
|
20821
|
+
object.customSignals[j] = $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.toObject(message.customSignals[j], options);
|
20822
|
+
}
|
20823
|
+
return object;
|
20824
|
+
};
|
20825
|
+
|
20826
|
+
/**
|
20827
|
+
* Converts this RankSignals to JSON.
|
20828
|
+
* @function toJSON
|
20829
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20830
|
+
* @instance
|
20831
|
+
* @returns {Object.<string,*>} JSON object
|
20832
|
+
*/
|
20833
|
+
RankSignals.prototype.toJSON = function toJSON() {
|
20834
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
20835
|
+
};
|
20836
|
+
|
20837
|
+
/**
|
20838
|
+
* Gets the default type url for RankSignals
|
20839
|
+
* @function getTypeUrl
|
20840
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20841
|
+
* @static
|
20842
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
20843
|
+
* @returns {string} The default type url
|
20844
|
+
*/
|
20845
|
+
RankSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
20846
|
+
if (typeUrlPrefix === undefined) {
|
20847
|
+
typeUrlPrefix = "type.googleapis.com";
|
20848
|
+
}
|
20849
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals";
|
20850
|
+
};
|
20851
|
+
|
20852
|
+
RankSignals.CustomSignal = (function() {
|
20853
|
+
|
20854
|
+
/**
|
20855
|
+
* Properties of a CustomSignal.
|
20856
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20857
|
+
* @interface ICustomSignal
|
20858
|
+
* @property {string|null} [name] CustomSignal name
|
20859
|
+
* @property {number|null} [value] CustomSignal value
|
20860
|
+
*/
|
20861
|
+
|
20862
|
+
/**
|
20863
|
+
* Constructs a new CustomSignal.
|
20864
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals
|
20865
|
+
* @classdesc Represents a CustomSignal.
|
20866
|
+
* @implements ICustomSignal
|
20867
|
+
* @constructor
|
20868
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
20869
|
+
*/
|
20870
|
+
function CustomSignal(properties) {
|
20871
|
+
if (properties)
|
20872
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
20873
|
+
if (properties[keys[i]] != null)
|
20874
|
+
this[keys[i]] = properties[keys[i]];
|
20875
|
+
}
|
20876
|
+
|
20877
|
+
/**
|
20878
|
+
* CustomSignal name.
|
20879
|
+
* @member {string} name
|
20880
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20881
|
+
* @instance
|
20882
|
+
*/
|
20883
|
+
CustomSignal.prototype.name = "";
|
20884
|
+
|
20885
|
+
/**
|
20886
|
+
* CustomSignal value.
|
20887
|
+
* @member {number} value
|
20888
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20889
|
+
* @instance
|
20890
|
+
*/
|
20891
|
+
CustomSignal.prototype.value = 0;
|
20892
|
+
|
20893
|
+
/**
|
20894
|
+
* Creates a new CustomSignal instance using the specified properties.
|
20895
|
+
* @function create
|
20896
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20897
|
+
* @static
|
20898
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
20899
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal instance
|
20900
|
+
*/
|
20901
|
+
CustomSignal.create = function create(properties) {
|
20902
|
+
return new CustomSignal(properties);
|
20903
|
+
};
|
20904
|
+
|
20905
|
+
/**
|
20906
|
+
* Encodes the specified CustomSignal message. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
20907
|
+
* @function encode
|
20908
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20909
|
+
* @static
|
20910
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
20911
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
20912
|
+
* @returns {$protobuf.Writer} Writer
|
20913
|
+
*/
|
20914
|
+
CustomSignal.encode = function encode(message, writer) {
|
20915
|
+
if (!writer)
|
20916
|
+
writer = $Writer.create();
|
20917
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
20918
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
20919
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
20920
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.value);
|
20921
|
+
return writer;
|
20922
|
+
};
|
20923
|
+
|
20924
|
+
/**
|
20925
|
+
* Encodes the specified CustomSignal message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
20926
|
+
* @function encodeDelimited
|
20927
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20928
|
+
* @static
|
20929
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
20930
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
20931
|
+
* @returns {$protobuf.Writer} Writer
|
20932
|
+
*/
|
20933
|
+
CustomSignal.encodeDelimited = function encodeDelimited(message, writer) {
|
20934
|
+
return this.encode(message, writer).ldelim();
|
20935
|
+
};
|
20936
|
+
|
20937
|
+
/**
|
20938
|
+
* Decodes a CustomSignal message from the specified reader or buffer.
|
20939
|
+
* @function decode
|
20940
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20941
|
+
* @static
|
20942
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20943
|
+
* @param {number} [length] Message length if known beforehand
|
20944
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
20945
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
20946
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20947
|
+
*/
|
20948
|
+
CustomSignal.decode = function decode(reader, length, error) {
|
20949
|
+
if (!(reader instanceof $Reader))
|
20950
|
+
reader = $Reader.create(reader);
|
20951
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
20952
|
+
while (reader.pos < end) {
|
20953
|
+
var tag = reader.uint32();
|
20954
|
+
if (tag === error)
|
20955
|
+
break;
|
20956
|
+
switch (tag >>> 3) {
|
20957
|
+
case 1: {
|
20958
|
+
message.name = reader.string();
|
20959
|
+
break;
|
20960
|
+
}
|
20961
|
+
case 2: {
|
20962
|
+
message.value = reader.float();
|
20963
|
+
break;
|
20964
|
+
}
|
20965
|
+
default:
|
20966
|
+
reader.skipType(tag & 7);
|
20967
|
+
break;
|
20968
|
+
}
|
20969
|
+
}
|
20970
|
+
return message;
|
20971
|
+
};
|
20972
|
+
|
20973
|
+
/**
|
20974
|
+
* Decodes a CustomSignal message from the specified reader or buffer, length delimited.
|
20975
|
+
* @function decodeDelimited
|
20976
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20977
|
+
* @static
|
20978
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
20979
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
20980
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
20981
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
20982
|
+
*/
|
20983
|
+
CustomSignal.decodeDelimited = function decodeDelimited(reader) {
|
20984
|
+
if (!(reader instanceof $Reader))
|
20985
|
+
reader = new $Reader(reader);
|
20986
|
+
return this.decode(reader, reader.uint32());
|
20987
|
+
};
|
20988
|
+
|
20989
|
+
/**
|
20990
|
+
* Verifies a CustomSignal message.
|
20991
|
+
* @function verify
|
20992
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
20993
|
+
* @static
|
20994
|
+
* @param {Object.<string,*>} message Plain object to verify
|
20995
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
20996
|
+
*/
|
20997
|
+
CustomSignal.verify = function verify(message) {
|
20998
|
+
if (typeof message !== "object" || message === null)
|
20999
|
+
return "object expected";
|
21000
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
21001
|
+
if (!$util.isString(message.name))
|
21002
|
+
return "name: string expected";
|
21003
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
21004
|
+
if (typeof message.value !== "number")
|
21005
|
+
return "value: number expected";
|
21006
|
+
return null;
|
21007
|
+
};
|
21008
|
+
|
21009
|
+
/**
|
21010
|
+
* Creates a CustomSignal message from a plain object. Also converts values to their respective internal types.
|
21011
|
+
* @function fromObject
|
21012
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
21013
|
+
* @static
|
21014
|
+
* @param {Object.<string,*>} object Plain object
|
21015
|
+
* @returns {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
21016
|
+
*/
|
21017
|
+
CustomSignal.fromObject = function fromObject(object) {
|
21018
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal)
|
21019
|
+
return object;
|
21020
|
+
var message = new $root.google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
21021
|
+
if (object.name != null)
|
21022
|
+
message.name = String(object.name);
|
21023
|
+
if (object.value != null)
|
21024
|
+
message.value = Number(object.value);
|
21025
|
+
return message;
|
21026
|
+
};
|
21027
|
+
|
21028
|
+
/**
|
21029
|
+
* Creates a plain object from a CustomSignal message. Also converts values to other types if specified.
|
21030
|
+
* @function toObject
|
21031
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
21032
|
+
* @static
|
21033
|
+
* @param {google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal} message CustomSignal
|
21034
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
21035
|
+
* @returns {Object.<string,*>} Plain object
|
21036
|
+
*/
|
21037
|
+
CustomSignal.toObject = function toObject(message, options) {
|
21038
|
+
if (!options)
|
21039
|
+
options = {};
|
21040
|
+
var object = {};
|
21041
|
+
if (options.defaults) {
|
21042
|
+
object.name = "";
|
21043
|
+
object.value = 0;
|
21044
|
+
}
|
21045
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
21046
|
+
object.name = message.name;
|
21047
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
21048
|
+
object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
21049
|
+
return object;
|
21050
|
+
};
|
21051
|
+
|
21052
|
+
/**
|
21053
|
+
* Converts this CustomSignal to JSON.
|
21054
|
+
* @function toJSON
|
21055
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
21056
|
+
* @instance
|
21057
|
+
* @returns {Object.<string,*>} JSON object
|
21058
|
+
*/
|
21059
|
+
CustomSignal.prototype.toJSON = function toJSON() {
|
21060
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
21061
|
+
};
|
21062
|
+
|
21063
|
+
/**
|
21064
|
+
* Gets the default type url for CustomSignal
|
21065
|
+
* @function getTypeUrl
|
21066
|
+
* @memberof google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal
|
21067
|
+
* @static
|
21068
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
21069
|
+
* @returns {string} The default type url
|
21070
|
+
*/
|
21071
|
+
CustomSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
21072
|
+
if (typeUrlPrefix === undefined) {
|
21073
|
+
typeUrlPrefix = "type.googleapis.com";
|
21074
|
+
}
|
21075
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal";
|
21076
|
+
};
|
21077
|
+
|
21078
|
+
return CustomSignal;
|
21079
|
+
})();
|
21080
|
+
|
21081
|
+
return RankSignals;
|
21082
|
+
})();
|
21083
|
+
|
20256
21084
|
return SearchResult;
|
20257
21085
|
})();
|
20258
21086
|
|
@@ -155433,6 +156261,7 @@
|
|
155433
156261
|
* @property {google.cloud.discoveryengine.v1alpha.SearchRequest.IContentSearchSpec|null} [contentSearchSpec] SearchRequest contentSearchSpec
|
155434
156262
|
* @property {google.cloud.discoveryengine.v1alpha.SearchRequest.IEmbeddingSpec|null} [embeddingSpec] SearchRequest embeddingSpec
|
155435
156263
|
* @property {string|null} [rankingExpression] SearchRequest rankingExpression
|
156264
|
+
* @property {google.cloud.discoveryengine.v1alpha.SearchRequest.RankingExpressionBackend|null} [rankingExpressionBackend] SearchRequest rankingExpressionBackend
|
155436
156265
|
* @property {boolean|null} [safeSearch] SearchRequest safeSearch
|
155437
156266
|
* @property {Object.<string,string>|null} [userLabels] SearchRequest userLabels
|
155438
156267
|
* @property {google.cloud.discoveryengine.v1alpha.SearchRequest.INaturalLanguageQueryUnderstandingSpec|null} [naturalLanguageQueryUnderstandingSpec] SearchRequest naturalLanguageQueryUnderstandingSpec
|
@@ -155646,6 +156475,14 @@
|
|
155646
156475
|
*/
|
155647
156476
|
SearchRequest.prototype.rankingExpression = "";
|
155648
156477
|
|
156478
|
+
/**
|
156479
|
+
* SearchRequest rankingExpressionBackend.
|
156480
|
+
* @member {google.cloud.discoveryengine.v1alpha.SearchRequest.RankingExpressionBackend} rankingExpressionBackend
|
156481
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchRequest
|
156482
|
+
* @instance
|
156483
|
+
*/
|
156484
|
+
SearchRequest.prototype.rankingExpressionBackend = 0;
|
156485
|
+
|
155649
156486
|
/**
|
155650
156487
|
* SearchRequest safeSearch.
|
155651
156488
|
* @member {boolean} safeSearch
|
@@ -155802,6 +156639,8 @@
|
|
155802
156639
|
$root.google.cloud.discoveryengine.v1alpha.SearchRequest.SessionSpec.encode(message.sessionSpec, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim();
|
155803
156640
|
if (message.relevanceThreshold != null && Object.hasOwnProperty.call(message, "relevanceThreshold"))
|
155804
156641
|
writer.uint32(/* id 44, wireType 0 =*/352).int32(message.relevanceThreshold);
|
156642
|
+
if (message.rankingExpressionBackend != null && Object.hasOwnProperty.call(message, "rankingExpressionBackend"))
|
156643
|
+
writer.uint32(/* id 53, wireType 0 =*/424).int32(message.rankingExpressionBackend);
|
155805
156644
|
return writer;
|
155806
156645
|
};
|
155807
156646
|
|
@@ -155953,6 +156792,10 @@
|
|
155953
156792
|
message.rankingExpression = reader.string();
|
155954
156793
|
break;
|
155955
156794
|
}
|
156795
|
+
case 53: {
|
156796
|
+
message.rankingExpressionBackend = reader.int32();
|
156797
|
+
break;
|
156798
|
+
}
|
155956
156799
|
case 20: {
|
155957
156800
|
message.safeSearch = reader.bool();
|
155958
156801
|
break;
|
@@ -156141,6 +156984,15 @@
|
|
156141
156984
|
if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression"))
|
156142
156985
|
if (!$util.isString(message.rankingExpression))
|
156143
156986
|
return "rankingExpression: string expected";
|
156987
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
156988
|
+
switch (message.rankingExpressionBackend) {
|
156989
|
+
default:
|
156990
|
+
return "rankingExpressionBackend: enum value expected";
|
156991
|
+
case 0:
|
156992
|
+
case 3:
|
156993
|
+
case 4:
|
156994
|
+
break;
|
156995
|
+
}
|
156144
156996
|
if (message.safeSearch != null && message.hasOwnProperty("safeSearch"))
|
156145
156997
|
if (typeof message.safeSearch !== "boolean")
|
156146
156998
|
return "safeSearch: boolean expected";
|
@@ -156292,6 +157144,26 @@
|
|
156292
157144
|
}
|
156293
157145
|
if (object.rankingExpression != null)
|
156294
157146
|
message.rankingExpression = String(object.rankingExpression);
|
157147
|
+
switch (object.rankingExpressionBackend) {
|
157148
|
+
default:
|
157149
|
+
if (typeof object.rankingExpressionBackend === "number") {
|
157150
|
+
message.rankingExpressionBackend = object.rankingExpressionBackend;
|
157151
|
+
break;
|
157152
|
+
}
|
157153
|
+
break;
|
157154
|
+
case "RANKING_EXPRESSION_BACKEND_UNSPECIFIED":
|
157155
|
+
case 0:
|
157156
|
+
message.rankingExpressionBackend = 0;
|
157157
|
+
break;
|
157158
|
+
case "RANK_BY_EMBEDDING":
|
157159
|
+
case 3:
|
157160
|
+
message.rankingExpressionBackend = 3;
|
157161
|
+
break;
|
157162
|
+
case "RANK_BY_FORMULA":
|
157163
|
+
case 4:
|
157164
|
+
message.rankingExpressionBackend = 4;
|
157165
|
+
break;
|
157166
|
+
}
|
156295
157167
|
if (object.safeSearch != null)
|
156296
157168
|
message.safeSearch = Boolean(object.safeSearch);
|
156297
157169
|
if (object.userLabels) {
|
@@ -156403,6 +157275,7 @@
|
|
156403
157275
|
object.session = "";
|
156404
157276
|
object.sessionSpec = null;
|
156405
157277
|
object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0;
|
157278
|
+
object.rankingExpressionBackend = options.enums === String ? "RANKING_EXPRESSION_BACKEND_UNSPECIFIED" : 0;
|
156406
157279
|
}
|
156407
157280
|
if (message.servingConfig != null && message.hasOwnProperty("servingConfig"))
|
156408
157281
|
object.servingConfig = message.servingConfig;
|
@@ -156479,6 +157352,8 @@
|
|
156479
157352
|
object.sessionSpec = $root.google.cloud.discoveryengine.v1alpha.SearchRequest.SessionSpec.toObject(message.sessionSpec, options);
|
156480
157353
|
if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold"))
|
156481
157354
|
object.relevanceThreshold = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] === undefined ? message.relevanceThreshold : $root.google.cloud.discoveryengine.v1alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold;
|
157355
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
157356
|
+
object.rankingExpressionBackend = options.enums === String ? $root.google.cloud.discoveryengine.v1alpha.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] === undefined ? message.rankingExpressionBackend : $root.google.cloud.discoveryengine.v1alpha.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] : message.rankingExpressionBackend;
|
156482
157357
|
return object;
|
156483
157358
|
};
|
156484
157359
|
|
@@ -162462,6 +163337,22 @@
|
|
162462
163337
|
return values;
|
162463
163338
|
})();
|
162464
163339
|
|
163340
|
+
/**
|
163341
|
+
* RankingExpressionBackend enum.
|
163342
|
+
* @name google.cloud.discoveryengine.v1alpha.SearchRequest.RankingExpressionBackend
|
163343
|
+
* @enum {number}
|
163344
|
+
* @property {number} RANKING_EXPRESSION_BACKEND_UNSPECIFIED=0 RANKING_EXPRESSION_BACKEND_UNSPECIFIED value
|
163345
|
+
* @property {number} RANK_BY_EMBEDDING=3 RANK_BY_EMBEDDING value
|
163346
|
+
* @property {number} RANK_BY_FORMULA=4 RANK_BY_FORMULA value
|
163347
|
+
*/
|
163348
|
+
SearchRequest.RankingExpressionBackend = (function() {
|
163349
|
+
var valuesById = {}, values = Object.create(valuesById);
|
163350
|
+
values[valuesById[0] = "RANKING_EXPRESSION_BACKEND_UNSPECIFIED"] = 0;
|
163351
|
+
values[valuesById[3] = "RANK_BY_EMBEDDING"] = 3;
|
163352
|
+
values[valuesById[4] = "RANK_BY_FORMULA"] = 4;
|
163353
|
+
return values;
|
163354
|
+
})();
|
163355
|
+
|
162465
163356
|
return SearchRequest;
|
162466
163357
|
})();
|
162467
163358
|
|
@@ -163127,6 +164018,7 @@
|
|
163127
164018
|
* @property {google.cloud.discoveryengine.v1alpha.IDocument|null} [document] SearchResult document
|
163128
164019
|
* @property {google.cloud.discoveryengine.v1alpha.IChunk|null} [chunk] SearchResult chunk
|
163129
164020
|
* @property {Object.<string,google.cloud.discoveryengine.v1alpha.IDoubleList>|null} [modelScores] SearchResult modelScores
|
164021
|
+
* @property {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals|null} [rankSignals] SearchResult rankSignals
|
163130
164022
|
*/
|
163131
164023
|
|
163132
164024
|
/**
|
@@ -163177,6 +164069,14 @@
|
|
163177
164069
|
*/
|
163178
164070
|
SearchResult.prototype.modelScores = $util.emptyObject;
|
163179
164071
|
|
164072
|
+
/**
|
164073
|
+
* SearchResult rankSignals.
|
164074
|
+
* @member {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals|null|undefined} rankSignals
|
164075
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult
|
164076
|
+
* @instance
|
164077
|
+
*/
|
164078
|
+
SearchResult.prototype.rankSignals = null;
|
164079
|
+
|
163180
164080
|
/**
|
163181
164081
|
* Creates a new SearchResult instance using the specified properties.
|
163182
164082
|
* @function create
|
@@ -163210,6 +164110,8 @@
|
|
163210
164110
|
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
|
163211
164111
|
$root.google.cloud.discoveryengine.v1alpha.DoubleList.encode(message.modelScores[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
|
163212
164112
|
}
|
164113
|
+
if (message.rankSignals != null && Object.hasOwnProperty.call(message, "rankSignals"))
|
164114
|
+
$root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.encode(message.rankSignals, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
163213
164115
|
if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
|
163214
164116
|
$root.google.cloud.discoveryengine.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
|
163215
164117
|
return writer;
|
@@ -163283,6 +164185,10 @@
|
|
163283
164185
|
message.modelScores[key] = value;
|
163284
164186
|
break;
|
163285
164187
|
}
|
164188
|
+
case 7: {
|
164189
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.decode(reader, reader.uint32());
|
164190
|
+
break;
|
164191
|
+
}
|
163286
164192
|
default:
|
163287
164193
|
reader.skipType(tag & 7);
|
163288
164194
|
break;
|
@@ -163341,6 +164247,11 @@
|
|
163341
164247
|
return "modelScores." + error;
|
163342
164248
|
}
|
163343
164249
|
}
|
164250
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals")) {
|
164251
|
+
var error = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.verify(message.rankSignals);
|
164252
|
+
if (error)
|
164253
|
+
return "rankSignals." + error;
|
164254
|
+
}
|
163344
164255
|
return null;
|
163345
164256
|
};
|
163346
164257
|
|
@@ -163378,6 +164289,11 @@
|
|
163378
164289
|
message.modelScores[keys[i]] = $root.google.cloud.discoveryengine.v1alpha.DoubleList.fromObject(object.modelScores[keys[i]]);
|
163379
164290
|
}
|
163380
164291
|
}
|
164292
|
+
if (object.rankSignals != null) {
|
164293
|
+
if (typeof object.rankSignals !== "object")
|
164294
|
+
throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.rankSignals: object expected");
|
164295
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.fromObject(object.rankSignals);
|
164296
|
+
}
|
163381
164297
|
return message;
|
163382
164298
|
};
|
163383
164299
|
|
@@ -163399,6 +164315,7 @@
|
|
163399
164315
|
if (options.defaults) {
|
163400
164316
|
object.id = "";
|
163401
164317
|
object.document = null;
|
164318
|
+
object.rankSignals = null;
|
163402
164319
|
object.chunk = null;
|
163403
164320
|
}
|
163404
164321
|
if (message.id != null && message.hasOwnProperty("id"))
|
@@ -163411,6 +164328,8 @@
|
|
163411
164328
|
for (var j = 0; j < keys2.length; ++j)
|
163412
164329
|
object.modelScores[keys2[j]] = $root.google.cloud.discoveryengine.v1alpha.DoubleList.toObject(message.modelScores[keys2[j]], options);
|
163413
164330
|
}
|
164331
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals"))
|
164332
|
+
object.rankSignals = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.toObject(message.rankSignals, options);
|
163414
164333
|
if (message.chunk != null && message.hasOwnProperty("chunk"))
|
163415
164334
|
object.chunk = $root.google.cloud.discoveryengine.v1alpha.Chunk.toObject(message.chunk, options);
|
163416
164335
|
return object;
|
@@ -163442,6 +164361,720 @@
|
|
163442
164361
|
return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult";
|
163443
164362
|
};
|
163444
164363
|
|
164364
|
+
SearchResult.RankSignals = (function() {
|
164365
|
+
|
164366
|
+
/**
|
164367
|
+
* Properties of a RankSignals.
|
164368
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult
|
164369
|
+
* @interface IRankSignals
|
164370
|
+
* @property {number|null} [keywordSimilarityScore] RankSignals keywordSimilarityScore
|
164371
|
+
* @property {number|null} [relevanceScore] RankSignals relevanceScore
|
164372
|
+
* @property {number|null} [semanticSimilarityScore] RankSignals semanticSimilarityScore
|
164373
|
+
* @property {number|null} [pctrRank] RankSignals pctrRank
|
164374
|
+
* @property {number|null} [topicalityRank] RankSignals topicalityRank
|
164375
|
+
* @property {number|null} [documentAge] RankSignals documentAge
|
164376
|
+
* @property {number|null} [boostingFactor] RankSignals boostingFactor
|
164377
|
+
* @property {number|null} [defaultRank] RankSignals defaultRank
|
164378
|
+
* @property {Array.<google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal>|null} [customSignals] RankSignals customSignals
|
164379
|
+
*/
|
164380
|
+
|
164381
|
+
/**
|
164382
|
+
* Constructs a new RankSignals.
|
164383
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult
|
164384
|
+
* @classdesc Represents a RankSignals.
|
164385
|
+
* @implements IRankSignals
|
164386
|
+
* @constructor
|
164387
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
164388
|
+
*/
|
164389
|
+
function RankSignals(properties) {
|
164390
|
+
this.customSignals = [];
|
164391
|
+
if (properties)
|
164392
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
164393
|
+
if (properties[keys[i]] != null)
|
164394
|
+
this[keys[i]] = properties[keys[i]];
|
164395
|
+
}
|
164396
|
+
|
164397
|
+
/**
|
164398
|
+
* RankSignals keywordSimilarityScore.
|
164399
|
+
* @member {number|null|undefined} keywordSimilarityScore
|
164400
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164401
|
+
* @instance
|
164402
|
+
*/
|
164403
|
+
RankSignals.prototype.keywordSimilarityScore = null;
|
164404
|
+
|
164405
|
+
/**
|
164406
|
+
* RankSignals relevanceScore.
|
164407
|
+
* @member {number|null|undefined} relevanceScore
|
164408
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164409
|
+
* @instance
|
164410
|
+
*/
|
164411
|
+
RankSignals.prototype.relevanceScore = null;
|
164412
|
+
|
164413
|
+
/**
|
164414
|
+
* RankSignals semanticSimilarityScore.
|
164415
|
+
* @member {number|null|undefined} semanticSimilarityScore
|
164416
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164417
|
+
* @instance
|
164418
|
+
*/
|
164419
|
+
RankSignals.prototype.semanticSimilarityScore = null;
|
164420
|
+
|
164421
|
+
/**
|
164422
|
+
* RankSignals pctrRank.
|
164423
|
+
* @member {number|null|undefined} pctrRank
|
164424
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164425
|
+
* @instance
|
164426
|
+
*/
|
164427
|
+
RankSignals.prototype.pctrRank = null;
|
164428
|
+
|
164429
|
+
/**
|
164430
|
+
* RankSignals topicalityRank.
|
164431
|
+
* @member {number|null|undefined} topicalityRank
|
164432
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164433
|
+
* @instance
|
164434
|
+
*/
|
164435
|
+
RankSignals.prototype.topicalityRank = null;
|
164436
|
+
|
164437
|
+
/**
|
164438
|
+
* RankSignals documentAge.
|
164439
|
+
* @member {number|null|undefined} documentAge
|
164440
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164441
|
+
* @instance
|
164442
|
+
*/
|
164443
|
+
RankSignals.prototype.documentAge = null;
|
164444
|
+
|
164445
|
+
/**
|
164446
|
+
* RankSignals boostingFactor.
|
164447
|
+
* @member {number|null|undefined} boostingFactor
|
164448
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164449
|
+
* @instance
|
164450
|
+
*/
|
164451
|
+
RankSignals.prototype.boostingFactor = null;
|
164452
|
+
|
164453
|
+
/**
|
164454
|
+
* RankSignals defaultRank.
|
164455
|
+
* @member {number} defaultRank
|
164456
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164457
|
+
* @instance
|
164458
|
+
*/
|
164459
|
+
RankSignals.prototype.defaultRank = 0;
|
164460
|
+
|
164461
|
+
/**
|
164462
|
+
* RankSignals customSignals.
|
164463
|
+
* @member {Array.<google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal>} customSignals
|
164464
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164465
|
+
* @instance
|
164466
|
+
*/
|
164467
|
+
RankSignals.prototype.customSignals = $util.emptyArray;
|
164468
|
+
|
164469
|
+
// OneOf field names bound to virtual getters and setters
|
164470
|
+
var $oneOfFields;
|
164471
|
+
|
164472
|
+
// Virtual OneOf for proto3 optional field
|
164473
|
+
Object.defineProperty(RankSignals.prototype, "_keywordSimilarityScore", {
|
164474
|
+
get: $util.oneOfGetter($oneOfFields = ["keywordSimilarityScore"]),
|
164475
|
+
set: $util.oneOfSetter($oneOfFields)
|
164476
|
+
});
|
164477
|
+
|
164478
|
+
// Virtual OneOf for proto3 optional field
|
164479
|
+
Object.defineProperty(RankSignals.prototype, "_relevanceScore", {
|
164480
|
+
get: $util.oneOfGetter($oneOfFields = ["relevanceScore"]),
|
164481
|
+
set: $util.oneOfSetter($oneOfFields)
|
164482
|
+
});
|
164483
|
+
|
164484
|
+
// Virtual OneOf for proto3 optional field
|
164485
|
+
Object.defineProperty(RankSignals.prototype, "_semanticSimilarityScore", {
|
164486
|
+
get: $util.oneOfGetter($oneOfFields = ["semanticSimilarityScore"]),
|
164487
|
+
set: $util.oneOfSetter($oneOfFields)
|
164488
|
+
});
|
164489
|
+
|
164490
|
+
// Virtual OneOf for proto3 optional field
|
164491
|
+
Object.defineProperty(RankSignals.prototype, "_pctrRank", {
|
164492
|
+
get: $util.oneOfGetter($oneOfFields = ["pctrRank"]),
|
164493
|
+
set: $util.oneOfSetter($oneOfFields)
|
164494
|
+
});
|
164495
|
+
|
164496
|
+
// Virtual OneOf for proto3 optional field
|
164497
|
+
Object.defineProperty(RankSignals.prototype, "_topicalityRank", {
|
164498
|
+
get: $util.oneOfGetter($oneOfFields = ["topicalityRank"]),
|
164499
|
+
set: $util.oneOfSetter($oneOfFields)
|
164500
|
+
});
|
164501
|
+
|
164502
|
+
// Virtual OneOf for proto3 optional field
|
164503
|
+
Object.defineProperty(RankSignals.prototype, "_documentAge", {
|
164504
|
+
get: $util.oneOfGetter($oneOfFields = ["documentAge"]),
|
164505
|
+
set: $util.oneOfSetter($oneOfFields)
|
164506
|
+
});
|
164507
|
+
|
164508
|
+
// Virtual OneOf for proto3 optional field
|
164509
|
+
Object.defineProperty(RankSignals.prototype, "_boostingFactor", {
|
164510
|
+
get: $util.oneOfGetter($oneOfFields = ["boostingFactor"]),
|
164511
|
+
set: $util.oneOfSetter($oneOfFields)
|
164512
|
+
});
|
164513
|
+
|
164514
|
+
/**
|
164515
|
+
* Creates a new RankSignals instance using the specified properties.
|
164516
|
+
* @function create
|
164517
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164518
|
+
* @static
|
164519
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
164520
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals} RankSignals instance
|
164521
|
+
*/
|
164522
|
+
RankSignals.create = function create(properties) {
|
164523
|
+
return new RankSignals(properties);
|
164524
|
+
};
|
164525
|
+
|
164526
|
+
/**
|
164527
|
+
* Encodes the specified RankSignals message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
164528
|
+
* @function encode
|
164529
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164530
|
+
* @static
|
164531
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
164532
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
164533
|
+
* @returns {$protobuf.Writer} Writer
|
164534
|
+
*/
|
164535
|
+
RankSignals.encode = function encode(message, writer) {
|
164536
|
+
if (!writer)
|
164537
|
+
writer = $Writer.create();
|
164538
|
+
if (message.keywordSimilarityScore != null && Object.hasOwnProperty.call(message, "keywordSimilarityScore"))
|
164539
|
+
writer.uint32(/* id 1, wireType 5 =*/13).float(message.keywordSimilarityScore);
|
164540
|
+
if (message.relevanceScore != null && Object.hasOwnProperty.call(message, "relevanceScore"))
|
164541
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.relevanceScore);
|
164542
|
+
if (message.semanticSimilarityScore != null && Object.hasOwnProperty.call(message, "semanticSimilarityScore"))
|
164543
|
+
writer.uint32(/* id 3, wireType 5 =*/29).float(message.semanticSimilarityScore);
|
164544
|
+
if (message.pctrRank != null && Object.hasOwnProperty.call(message, "pctrRank"))
|
164545
|
+
writer.uint32(/* id 4, wireType 5 =*/37).float(message.pctrRank);
|
164546
|
+
if (message.topicalityRank != null && Object.hasOwnProperty.call(message, "topicalityRank"))
|
164547
|
+
writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicalityRank);
|
164548
|
+
if (message.documentAge != null && Object.hasOwnProperty.call(message, "documentAge"))
|
164549
|
+
writer.uint32(/* id 7, wireType 5 =*/61).float(message.documentAge);
|
164550
|
+
if (message.boostingFactor != null && Object.hasOwnProperty.call(message, "boostingFactor"))
|
164551
|
+
writer.uint32(/* id 8, wireType 5 =*/69).float(message.boostingFactor);
|
164552
|
+
if (message.defaultRank != null && Object.hasOwnProperty.call(message, "defaultRank"))
|
164553
|
+
writer.uint32(/* id 32, wireType 5 =*/261).float(message.defaultRank);
|
164554
|
+
if (message.customSignals != null && message.customSignals.length)
|
164555
|
+
for (var i = 0; i < message.customSignals.length; ++i)
|
164556
|
+
$root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.encode(message.customSignals[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim();
|
164557
|
+
return writer;
|
164558
|
+
};
|
164559
|
+
|
164560
|
+
/**
|
164561
|
+
* Encodes the specified RankSignals message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
164562
|
+
* @function encodeDelimited
|
164563
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164564
|
+
* @static
|
164565
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
164566
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
164567
|
+
* @returns {$protobuf.Writer} Writer
|
164568
|
+
*/
|
164569
|
+
RankSignals.encodeDelimited = function encodeDelimited(message, writer) {
|
164570
|
+
return this.encode(message, writer).ldelim();
|
164571
|
+
};
|
164572
|
+
|
164573
|
+
/**
|
164574
|
+
* Decodes a RankSignals message from the specified reader or buffer.
|
164575
|
+
* @function decode
|
164576
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164577
|
+
* @static
|
164578
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
164579
|
+
* @param {number} [length] Message length if known beforehand
|
164580
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals} RankSignals
|
164581
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
164582
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
164583
|
+
*/
|
164584
|
+
RankSignals.decode = function decode(reader, length, error) {
|
164585
|
+
if (!(reader instanceof $Reader))
|
164586
|
+
reader = $Reader.create(reader);
|
164587
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals();
|
164588
|
+
while (reader.pos < end) {
|
164589
|
+
var tag = reader.uint32();
|
164590
|
+
if (tag === error)
|
164591
|
+
break;
|
164592
|
+
switch (tag >>> 3) {
|
164593
|
+
case 1: {
|
164594
|
+
message.keywordSimilarityScore = reader.float();
|
164595
|
+
break;
|
164596
|
+
}
|
164597
|
+
case 2: {
|
164598
|
+
message.relevanceScore = reader.float();
|
164599
|
+
break;
|
164600
|
+
}
|
164601
|
+
case 3: {
|
164602
|
+
message.semanticSimilarityScore = reader.float();
|
164603
|
+
break;
|
164604
|
+
}
|
164605
|
+
case 4: {
|
164606
|
+
message.pctrRank = reader.float();
|
164607
|
+
break;
|
164608
|
+
}
|
164609
|
+
case 6: {
|
164610
|
+
message.topicalityRank = reader.float();
|
164611
|
+
break;
|
164612
|
+
}
|
164613
|
+
case 7: {
|
164614
|
+
message.documentAge = reader.float();
|
164615
|
+
break;
|
164616
|
+
}
|
164617
|
+
case 8: {
|
164618
|
+
message.boostingFactor = reader.float();
|
164619
|
+
break;
|
164620
|
+
}
|
164621
|
+
case 32: {
|
164622
|
+
message.defaultRank = reader.float();
|
164623
|
+
break;
|
164624
|
+
}
|
164625
|
+
case 33: {
|
164626
|
+
if (!(message.customSignals && message.customSignals.length))
|
164627
|
+
message.customSignals = [];
|
164628
|
+
message.customSignals.push($root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.decode(reader, reader.uint32()));
|
164629
|
+
break;
|
164630
|
+
}
|
164631
|
+
default:
|
164632
|
+
reader.skipType(tag & 7);
|
164633
|
+
break;
|
164634
|
+
}
|
164635
|
+
}
|
164636
|
+
return message;
|
164637
|
+
};
|
164638
|
+
|
164639
|
+
/**
|
164640
|
+
* Decodes a RankSignals message from the specified reader or buffer, length delimited.
|
164641
|
+
* @function decodeDelimited
|
164642
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164643
|
+
* @static
|
164644
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
164645
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals} RankSignals
|
164646
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
164647
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
164648
|
+
*/
|
164649
|
+
RankSignals.decodeDelimited = function decodeDelimited(reader) {
|
164650
|
+
if (!(reader instanceof $Reader))
|
164651
|
+
reader = new $Reader(reader);
|
164652
|
+
return this.decode(reader, reader.uint32());
|
164653
|
+
};
|
164654
|
+
|
164655
|
+
/**
|
164656
|
+
* Verifies a RankSignals message.
|
164657
|
+
* @function verify
|
164658
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164659
|
+
* @static
|
164660
|
+
* @param {Object.<string,*>} message Plain object to verify
|
164661
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
164662
|
+
*/
|
164663
|
+
RankSignals.verify = function verify(message) {
|
164664
|
+
if (typeof message !== "object" || message === null)
|
164665
|
+
return "object expected";
|
164666
|
+
var properties = {};
|
164667
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
164668
|
+
properties._keywordSimilarityScore = 1;
|
164669
|
+
if (typeof message.keywordSimilarityScore !== "number")
|
164670
|
+
return "keywordSimilarityScore: number expected";
|
164671
|
+
}
|
164672
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
164673
|
+
properties._relevanceScore = 1;
|
164674
|
+
if (typeof message.relevanceScore !== "number")
|
164675
|
+
return "relevanceScore: number expected";
|
164676
|
+
}
|
164677
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
164678
|
+
properties._semanticSimilarityScore = 1;
|
164679
|
+
if (typeof message.semanticSimilarityScore !== "number")
|
164680
|
+
return "semanticSimilarityScore: number expected";
|
164681
|
+
}
|
164682
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
164683
|
+
properties._pctrRank = 1;
|
164684
|
+
if (typeof message.pctrRank !== "number")
|
164685
|
+
return "pctrRank: number expected";
|
164686
|
+
}
|
164687
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
164688
|
+
properties._topicalityRank = 1;
|
164689
|
+
if (typeof message.topicalityRank !== "number")
|
164690
|
+
return "topicalityRank: number expected";
|
164691
|
+
}
|
164692
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
164693
|
+
properties._documentAge = 1;
|
164694
|
+
if (typeof message.documentAge !== "number")
|
164695
|
+
return "documentAge: number expected";
|
164696
|
+
}
|
164697
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
164698
|
+
properties._boostingFactor = 1;
|
164699
|
+
if (typeof message.boostingFactor !== "number")
|
164700
|
+
return "boostingFactor: number expected";
|
164701
|
+
}
|
164702
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
164703
|
+
if (typeof message.defaultRank !== "number")
|
164704
|
+
return "defaultRank: number expected";
|
164705
|
+
if (message.customSignals != null && message.hasOwnProperty("customSignals")) {
|
164706
|
+
if (!Array.isArray(message.customSignals))
|
164707
|
+
return "customSignals: array expected";
|
164708
|
+
for (var i = 0; i < message.customSignals.length; ++i) {
|
164709
|
+
var error = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.verify(message.customSignals[i]);
|
164710
|
+
if (error)
|
164711
|
+
return "customSignals." + error;
|
164712
|
+
}
|
164713
|
+
}
|
164714
|
+
return null;
|
164715
|
+
};
|
164716
|
+
|
164717
|
+
/**
|
164718
|
+
* Creates a RankSignals message from a plain object. Also converts values to their respective internal types.
|
164719
|
+
* @function fromObject
|
164720
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164721
|
+
* @static
|
164722
|
+
* @param {Object.<string,*>} object Plain object
|
164723
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals} RankSignals
|
164724
|
+
*/
|
164725
|
+
RankSignals.fromObject = function fromObject(object) {
|
164726
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals)
|
164727
|
+
return object;
|
164728
|
+
var message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals();
|
164729
|
+
if (object.keywordSimilarityScore != null)
|
164730
|
+
message.keywordSimilarityScore = Number(object.keywordSimilarityScore);
|
164731
|
+
if (object.relevanceScore != null)
|
164732
|
+
message.relevanceScore = Number(object.relevanceScore);
|
164733
|
+
if (object.semanticSimilarityScore != null)
|
164734
|
+
message.semanticSimilarityScore = Number(object.semanticSimilarityScore);
|
164735
|
+
if (object.pctrRank != null)
|
164736
|
+
message.pctrRank = Number(object.pctrRank);
|
164737
|
+
if (object.topicalityRank != null)
|
164738
|
+
message.topicalityRank = Number(object.topicalityRank);
|
164739
|
+
if (object.documentAge != null)
|
164740
|
+
message.documentAge = Number(object.documentAge);
|
164741
|
+
if (object.boostingFactor != null)
|
164742
|
+
message.boostingFactor = Number(object.boostingFactor);
|
164743
|
+
if (object.defaultRank != null)
|
164744
|
+
message.defaultRank = Number(object.defaultRank);
|
164745
|
+
if (object.customSignals) {
|
164746
|
+
if (!Array.isArray(object.customSignals))
|
164747
|
+
throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.customSignals: array expected");
|
164748
|
+
message.customSignals = [];
|
164749
|
+
for (var i = 0; i < object.customSignals.length; ++i) {
|
164750
|
+
if (typeof object.customSignals[i] !== "object")
|
164751
|
+
throw TypeError(".google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.customSignals: object expected");
|
164752
|
+
message.customSignals[i] = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.fromObject(object.customSignals[i]);
|
164753
|
+
}
|
164754
|
+
}
|
164755
|
+
return message;
|
164756
|
+
};
|
164757
|
+
|
164758
|
+
/**
|
164759
|
+
* Creates a plain object from a RankSignals message. Also converts values to other types if specified.
|
164760
|
+
* @function toObject
|
164761
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164762
|
+
* @static
|
164763
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals} message RankSignals
|
164764
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
164765
|
+
* @returns {Object.<string,*>} Plain object
|
164766
|
+
*/
|
164767
|
+
RankSignals.toObject = function toObject(message, options) {
|
164768
|
+
if (!options)
|
164769
|
+
options = {};
|
164770
|
+
var object = {};
|
164771
|
+
if (options.arrays || options.defaults)
|
164772
|
+
object.customSignals = [];
|
164773
|
+
if (options.defaults)
|
164774
|
+
object.defaultRank = 0;
|
164775
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
164776
|
+
object.keywordSimilarityScore = options.json && !isFinite(message.keywordSimilarityScore) ? String(message.keywordSimilarityScore) : message.keywordSimilarityScore;
|
164777
|
+
if (options.oneofs)
|
164778
|
+
object._keywordSimilarityScore = "keywordSimilarityScore";
|
164779
|
+
}
|
164780
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
164781
|
+
object.relevanceScore = options.json && !isFinite(message.relevanceScore) ? String(message.relevanceScore) : message.relevanceScore;
|
164782
|
+
if (options.oneofs)
|
164783
|
+
object._relevanceScore = "relevanceScore";
|
164784
|
+
}
|
164785
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
164786
|
+
object.semanticSimilarityScore = options.json && !isFinite(message.semanticSimilarityScore) ? String(message.semanticSimilarityScore) : message.semanticSimilarityScore;
|
164787
|
+
if (options.oneofs)
|
164788
|
+
object._semanticSimilarityScore = "semanticSimilarityScore";
|
164789
|
+
}
|
164790
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
164791
|
+
object.pctrRank = options.json && !isFinite(message.pctrRank) ? String(message.pctrRank) : message.pctrRank;
|
164792
|
+
if (options.oneofs)
|
164793
|
+
object._pctrRank = "pctrRank";
|
164794
|
+
}
|
164795
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
164796
|
+
object.topicalityRank = options.json && !isFinite(message.topicalityRank) ? String(message.topicalityRank) : message.topicalityRank;
|
164797
|
+
if (options.oneofs)
|
164798
|
+
object._topicalityRank = "topicalityRank";
|
164799
|
+
}
|
164800
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
164801
|
+
object.documentAge = options.json && !isFinite(message.documentAge) ? String(message.documentAge) : message.documentAge;
|
164802
|
+
if (options.oneofs)
|
164803
|
+
object._documentAge = "documentAge";
|
164804
|
+
}
|
164805
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
164806
|
+
object.boostingFactor = options.json && !isFinite(message.boostingFactor) ? String(message.boostingFactor) : message.boostingFactor;
|
164807
|
+
if (options.oneofs)
|
164808
|
+
object._boostingFactor = "boostingFactor";
|
164809
|
+
}
|
164810
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
164811
|
+
object.defaultRank = options.json && !isFinite(message.defaultRank) ? String(message.defaultRank) : message.defaultRank;
|
164812
|
+
if (message.customSignals && message.customSignals.length) {
|
164813
|
+
object.customSignals = [];
|
164814
|
+
for (var j = 0; j < message.customSignals.length; ++j)
|
164815
|
+
object.customSignals[j] = $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.toObject(message.customSignals[j], options);
|
164816
|
+
}
|
164817
|
+
return object;
|
164818
|
+
};
|
164819
|
+
|
164820
|
+
/**
|
164821
|
+
* Converts this RankSignals to JSON.
|
164822
|
+
* @function toJSON
|
164823
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164824
|
+
* @instance
|
164825
|
+
* @returns {Object.<string,*>} JSON object
|
164826
|
+
*/
|
164827
|
+
RankSignals.prototype.toJSON = function toJSON() {
|
164828
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
164829
|
+
};
|
164830
|
+
|
164831
|
+
/**
|
164832
|
+
* Gets the default type url for RankSignals
|
164833
|
+
* @function getTypeUrl
|
164834
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164835
|
+
* @static
|
164836
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
164837
|
+
* @returns {string} The default type url
|
164838
|
+
*/
|
164839
|
+
RankSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
164840
|
+
if (typeUrlPrefix === undefined) {
|
164841
|
+
typeUrlPrefix = "type.googleapis.com";
|
164842
|
+
}
|
164843
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals";
|
164844
|
+
};
|
164845
|
+
|
164846
|
+
RankSignals.CustomSignal = (function() {
|
164847
|
+
|
164848
|
+
/**
|
164849
|
+
* Properties of a CustomSignal.
|
164850
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164851
|
+
* @interface ICustomSignal
|
164852
|
+
* @property {string|null} [name] CustomSignal name
|
164853
|
+
* @property {number|null} [value] CustomSignal value
|
164854
|
+
*/
|
164855
|
+
|
164856
|
+
/**
|
164857
|
+
* Constructs a new CustomSignal.
|
164858
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals
|
164859
|
+
* @classdesc Represents a CustomSignal.
|
164860
|
+
* @implements ICustomSignal
|
164861
|
+
* @constructor
|
164862
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
164863
|
+
*/
|
164864
|
+
function CustomSignal(properties) {
|
164865
|
+
if (properties)
|
164866
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
164867
|
+
if (properties[keys[i]] != null)
|
164868
|
+
this[keys[i]] = properties[keys[i]];
|
164869
|
+
}
|
164870
|
+
|
164871
|
+
/**
|
164872
|
+
* CustomSignal name.
|
164873
|
+
* @member {string} name
|
164874
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164875
|
+
* @instance
|
164876
|
+
*/
|
164877
|
+
CustomSignal.prototype.name = "";
|
164878
|
+
|
164879
|
+
/**
|
164880
|
+
* CustomSignal value.
|
164881
|
+
* @member {number} value
|
164882
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164883
|
+
* @instance
|
164884
|
+
*/
|
164885
|
+
CustomSignal.prototype.value = 0;
|
164886
|
+
|
164887
|
+
/**
|
164888
|
+
* Creates a new CustomSignal instance using the specified properties.
|
164889
|
+
* @function create
|
164890
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164891
|
+
* @static
|
164892
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
164893
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal instance
|
164894
|
+
*/
|
164895
|
+
CustomSignal.create = function create(properties) {
|
164896
|
+
return new CustomSignal(properties);
|
164897
|
+
};
|
164898
|
+
|
164899
|
+
/**
|
164900
|
+
* Encodes the specified CustomSignal message. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
164901
|
+
* @function encode
|
164902
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164903
|
+
* @static
|
164904
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
164905
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
164906
|
+
* @returns {$protobuf.Writer} Writer
|
164907
|
+
*/
|
164908
|
+
CustomSignal.encode = function encode(message, writer) {
|
164909
|
+
if (!writer)
|
164910
|
+
writer = $Writer.create();
|
164911
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
164912
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
164913
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
164914
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.value);
|
164915
|
+
return writer;
|
164916
|
+
};
|
164917
|
+
|
164918
|
+
/**
|
164919
|
+
* Encodes the specified CustomSignal message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
164920
|
+
* @function encodeDelimited
|
164921
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164922
|
+
* @static
|
164923
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
164924
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
164925
|
+
* @returns {$protobuf.Writer} Writer
|
164926
|
+
*/
|
164927
|
+
CustomSignal.encodeDelimited = function encodeDelimited(message, writer) {
|
164928
|
+
return this.encode(message, writer).ldelim();
|
164929
|
+
};
|
164930
|
+
|
164931
|
+
/**
|
164932
|
+
* Decodes a CustomSignal message from the specified reader or buffer.
|
164933
|
+
* @function decode
|
164934
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164935
|
+
* @static
|
164936
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
164937
|
+
* @param {number} [length] Message length if known beforehand
|
164938
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
164939
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
164940
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
164941
|
+
*/
|
164942
|
+
CustomSignal.decode = function decode(reader, length, error) {
|
164943
|
+
if (!(reader instanceof $Reader))
|
164944
|
+
reader = $Reader.create(reader);
|
164945
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
164946
|
+
while (reader.pos < end) {
|
164947
|
+
var tag = reader.uint32();
|
164948
|
+
if (tag === error)
|
164949
|
+
break;
|
164950
|
+
switch (tag >>> 3) {
|
164951
|
+
case 1: {
|
164952
|
+
message.name = reader.string();
|
164953
|
+
break;
|
164954
|
+
}
|
164955
|
+
case 2: {
|
164956
|
+
message.value = reader.float();
|
164957
|
+
break;
|
164958
|
+
}
|
164959
|
+
default:
|
164960
|
+
reader.skipType(tag & 7);
|
164961
|
+
break;
|
164962
|
+
}
|
164963
|
+
}
|
164964
|
+
return message;
|
164965
|
+
};
|
164966
|
+
|
164967
|
+
/**
|
164968
|
+
* Decodes a CustomSignal message from the specified reader or buffer, length delimited.
|
164969
|
+
* @function decodeDelimited
|
164970
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164971
|
+
* @static
|
164972
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
164973
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
164974
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
164975
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
164976
|
+
*/
|
164977
|
+
CustomSignal.decodeDelimited = function decodeDelimited(reader) {
|
164978
|
+
if (!(reader instanceof $Reader))
|
164979
|
+
reader = new $Reader(reader);
|
164980
|
+
return this.decode(reader, reader.uint32());
|
164981
|
+
};
|
164982
|
+
|
164983
|
+
/**
|
164984
|
+
* Verifies a CustomSignal message.
|
164985
|
+
* @function verify
|
164986
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
164987
|
+
* @static
|
164988
|
+
* @param {Object.<string,*>} message Plain object to verify
|
164989
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
164990
|
+
*/
|
164991
|
+
CustomSignal.verify = function verify(message) {
|
164992
|
+
if (typeof message !== "object" || message === null)
|
164993
|
+
return "object expected";
|
164994
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
164995
|
+
if (!$util.isString(message.name))
|
164996
|
+
return "name: string expected";
|
164997
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
164998
|
+
if (typeof message.value !== "number")
|
164999
|
+
return "value: number expected";
|
165000
|
+
return null;
|
165001
|
+
};
|
165002
|
+
|
165003
|
+
/**
|
165004
|
+
* Creates a CustomSignal message from a plain object. Also converts values to their respective internal types.
|
165005
|
+
* @function fromObject
|
165006
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
165007
|
+
* @static
|
165008
|
+
* @param {Object.<string,*>} object Plain object
|
165009
|
+
* @returns {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
165010
|
+
*/
|
165011
|
+
CustomSignal.fromObject = function fromObject(object) {
|
165012
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal)
|
165013
|
+
return object;
|
165014
|
+
var message = new $root.google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
165015
|
+
if (object.name != null)
|
165016
|
+
message.name = String(object.name);
|
165017
|
+
if (object.value != null)
|
165018
|
+
message.value = Number(object.value);
|
165019
|
+
return message;
|
165020
|
+
};
|
165021
|
+
|
165022
|
+
/**
|
165023
|
+
* Creates a plain object from a CustomSignal message. Also converts values to other types if specified.
|
165024
|
+
* @function toObject
|
165025
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
165026
|
+
* @static
|
165027
|
+
* @param {google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal} message CustomSignal
|
165028
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
165029
|
+
* @returns {Object.<string,*>} Plain object
|
165030
|
+
*/
|
165031
|
+
CustomSignal.toObject = function toObject(message, options) {
|
165032
|
+
if (!options)
|
165033
|
+
options = {};
|
165034
|
+
var object = {};
|
165035
|
+
if (options.defaults) {
|
165036
|
+
object.name = "";
|
165037
|
+
object.value = 0;
|
165038
|
+
}
|
165039
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
165040
|
+
object.name = message.name;
|
165041
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
165042
|
+
object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
165043
|
+
return object;
|
165044
|
+
};
|
165045
|
+
|
165046
|
+
/**
|
165047
|
+
* Converts this CustomSignal to JSON.
|
165048
|
+
* @function toJSON
|
165049
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
165050
|
+
* @instance
|
165051
|
+
* @returns {Object.<string,*>} JSON object
|
165052
|
+
*/
|
165053
|
+
CustomSignal.prototype.toJSON = function toJSON() {
|
165054
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
165055
|
+
};
|
165056
|
+
|
165057
|
+
/**
|
165058
|
+
* Gets the default type url for CustomSignal
|
165059
|
+
* @function getTypeUrl
|
165060
|
+
* @memberof google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal
|
165061
|
+
* @static
|
165062
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
165063
|
+
* @returns {string} The default type url
|
165064
|
+
*/
|
165065
|
+
CustomSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
165066
|
+
if (typeUrlPrefix === undefined) {
|
165067
|
+
typeUrlPrefix = "type.googleapis.com";
|
165068
|
+
}
|
165069
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult.RankSignals.CustomSignal";
|
165070
|
+
};
|
165071
|
+
|
165072
|
+
return CustomSignal;
|
165073
|
+
})();
|
165074
|
+
|
165075
|
+
return RankSignals;
|
165076
|
+
})();
|
165077
|
+
|
163445
165078
|
return SearchResult;
|
163446
165079
|
})();
|
163447
165080
|
|
@@ -267647,6 +269280,7 @@
|
|
267647
269280
|
* @property {google.cloud.discoveryengine.v1beta.SearchRequest.IContentSearchSpec|null} [contentSearchSpec] SearchRequest contentSearchSpec
|
267648
269281
|
* @property {google.cloud.discoveryengine.v1beta.SearchRequest.IEmbeddingSpec|null} [embeddingSpec] SearchRequest embeddingSpec
|
267649
269282
|
* @property {string|null} [rankingExpression] SearchRequest rankingExpression
|
269283
|
+
* @property {google.cloud.discoveryengine.v1beta.SearchRequest.RankingExpressionBackend|null} [rankingExpressionBackend] SearchRequest rankingExpressionBackend
|
267650
269284
|
* @property {boolean|null} [safeSearch] SearchRequest safeSearch
|
267651
269285
|
* @property {Object.<string,string>|null} [userLabels] SearchRequest userLabels
|
267652
269286
|
* @property {google.cloud.discoveryengine.v1beta.SearchRequest.INaturalLanguageQueryUnderstandingSpec|null} [naturalLanguageQueryUnderstandingSpec] SearchRequest naturalLanguageQueryUnderstandingSpec
|
@@ -267868,6 +269502,14 @@
|
|
267868
269502
|
*/
|
267869
269503
|
SearchRequest.prototype.rankingExpression = "";
|
267870
269504
|
|
269505
|
+
/**
|
269506
|
+
* SearchRequest rankingExpressionBackend.
|
269507
|
+
* @member {google.cloud.discoveryengine.v1beta.SearchRequest.RankingExpressionBackend} rankingExpressionBackend
|
269508
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchRequest
|
269509
|
+
* @instance
|
269510
|
+
*/
|
269511
|
+
SearchRequest.prototype.rankingExpressionBackend = 0;
|
269512
|
+
|
267871
269513
|
/**
|
267872
269514
|
* SearchRequest safeSearch.
|
267873
269515
|
* @member {boolean} safeSearch
|
@@ -268026,6 +269668,8 @@
|
|
268026
269668
|
$root.google.cloud.discoveryengine.v1beta.SearchRequest.PersonalizationSpec.encode(message.personalizationSpec, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim();
|
268027
269669
|
if (message.oneBoxPageSize != null && Object.hasOwnProperty.call(message, "oneBoxPageSize"))
|
268028
269670
|
writer.uint32(/* id 47, wireType 0 =*/376).int32(message.oneBoxPageSize);
|
269671
|
+
if (message.rankingExpressionBackend != null && Object.hasOwnProperty.call(message, "rankingExpressionBackend"))
|
269672
|
+
writer.uint32(/* id 53, wireType 0 =*/424).int32(message.rankingExpressionBackend);
|
268029
269673
|
return writer;
|
268030
269674
|
};
|
268031
269675
|
|
@@ -268181,6 +269825,10 @@
|
|
268181
269825
|
message.rankingExpression = reader.string();
|
268182
269826
|
break;
|
268183
269827
|
}
|
269828
|
+
case 53: {
|
269829
|
+
message.rankingExpressionBackend = reader.int32();
|
269830
|
+
break;
|
269831
|
+
}
|
268184
269832
|
case 20: {
|
268185
269833
|
message.safeSearch = reader.bool();
|
268186
269834
|
break;
|
@@ -268372,6 +270020,15 @@
|
|
268372
270020
|
if (message.rankingExpression != null && message.hasOwnProperty("rankingExpression"))
|
268373
270021
|
if (!$util.isString(message.rankingExpression))
|
268374
270022
|
return "rankingExpression: string expected";
|
270023
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
270024
|
+
switch (message.rankingExpressionBackend) {
|
270025
|
+
default:
|
270026
|
+
return "rankingExpressionBackend: enum value expected";
|
270027
|
+
case 0:
|
270028
|
+
case 3:
|
270029
|
+
case 4:
|
270030
|
+
break;
|
270031
|
+
}
|
268375
270032
|
if (message.safeSearch != null && message.hasOwnProperty("safeSearch"))
|
268376
270033
|
if (typeof message.safeSearch !== "boolean")
|
268377
270034
|
return "safeSearch: boolean expected";
|
@@ -268525,6 +270182,26 @@
|
|
268525
270182
|
}
|
268526
270183
|
if (object.rankingExpression != null)
|
268527
270184
|
message.rankingExpression = String(object.rankingExpression);
|
270185
|
+
switch (object.rankingExpressionBackend) {
|
270186
|
+
default:
|
270187
|
+
if (typeof object.rankingExpressionBackend === "number") {
|
270188
|
+
message.rankingExpressionBackend = object.rankingExpressionBackend;
|
270189
|
+
break;
|
270190
|
+
}
|
270191
|
+
break;
|
270192
|
+
case "RANKING_EXPRESSION_BACKEND_UNSPECIFIED":
|
270193
|
+
case 0:
|
270194
|
+
message.rankingExpressionBackend = 0;
|
270195
|
+
break;
|
270196
|
+
case "RANK_BY_EMBEDDING":
|
270197
|
+
case 3:
|
270198
|
+
message.rankingExpressionBackend = 3;
|
270199
|
+
break;
|
270200
|
+
case "RANK_BY_FORMULA":
|
270201
|
+
case 4:
|
270202
|
+
message.rankingExpressionBackend = 4;
|
270203
|
+
break;
|
270204
|
+
}
|
268528
270205
|
if (object.safeSearch != null)
|
268529
270206
|
message.safeSearch = Boolean(object.safeSearch);
|
268530
270207
|
if (object.userLabels) {
|
@@ -268637,6 +270314,7 @@
|
|
268637
270314
|
object.relevanceThreshold = options.enums === String ? "RELEVANCE_THRESHOLD_UNSPECIFIED" : 0;
|
268638
270315
|
object.personalizationSpec = null;
|
268639
270316
|
object.oneBoxPageSize = 0;
|
270317
|
+
object.rankingExpressionBackend = options.enums === String ? "RANKING_EXPRESSION_BACKEND_UNSPECIFIED" : 0;
|
268640
270318
|
}
|
268641
270319
|
if (message.servingConfig != null && message.hasOwnProperty("servingConfig"))
|
268642
270320
|
object.servingConfig = message.servingConfig;
|
@@ -268715,6 +270393,8 @@
|
|
268715
270393
|
object.personalizationSpec = $root.google.cloud.discoveryengine.v1beta.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options);
|
268716
270394
|
if (message.oneBoxPageSize != null && message.hasOwnProperty("oneBoxPageSize"))
|
268717
270395
|
object.oneBoxPageSize = message.oneBoxPageSize;
|
270396
|
+
if (message.rankingExpressionBackend != null && message.hasOwnProperty("rankingExpressionBackend"))
|
270397
|
+
object.rankingExpressionBackend = options.enums === String ? $root.google.cloud.discoveryengine.v1beta.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] === undefined ? message.rankingExpressionBackend : $root.google.cloud.discoveryengine.v1beta.SearchRequest.RankingExpressionBackend[message.rankingExpressionBackend] : message.rankingExpressionBackend;
|
268718
270398
|
return object;
|
268719
270399
|
};
|
268720
270400
|
|
@@ -274990,6 +276670,22 @@
|
|
274990
276670
|
return values;
|
274991
276671
|
})();
|
274992
276672
|
|
276673
|
+
/**
|
276674
|
+
* RankingExpressionBackend enum.
|
276675
|
+
* @name google.cloud.discoveryengine.v1beta.SearchRequest.RankingExpressionBackend
|
276676
|
+
* @enum {number}
|
276677
|
+
* @property {number} RANKING_EXPRESSION_BACKEND_UNSPECIFIED=0 RANKING_EXPRESSION_BACKEND_UNSPECIFIED value
|
276678
|
+
* @property {number} RANK_BY_EMBEDDING=3 RANK_BY_EMBEDDING value
|
276679
|
+
* @property {number} RANK_BY_FORMULA=4 RANK_BY_FORMULA value
|
276680
|
+
*/
|
276681
|
+
SearchRequest.RankingExpressionBackend = (function() {
|
276682
|
+
var valuesById = {}, values = Object.create(valuesById);
|
276683
|
+
values[valuesById[0] = "RANKING_EXPRESSION_BACKEND_UNSPECIFIED"] = 0;
|
276684
|
+
values[valuesById[3] = "RANK_BY_EMBEDDING"] = 3;
|
276685
|
+
values[valuesById[4] = "RANK_BY_FORMULA"] = 4;
|
276686
|
+
return values;
|
276687
|
+
})();
|
276688
|
+
|
274993
276689
|
return SearchRequest;
|
274994
276690
|
})();
|
274995
276691
|
|
@@ -275655,6 +277351,7 @@
|
|
275655
277351
|
* @property {google.cloud.discoveryengine.v1beta.IDocument|null} [document] SearchResult document
|
275656
277352
|
* @property {google.cloud.discoveryengine.v1beta.IChunk|null} [chunk] SearchResult chunk
|
275657
277353
|
* @property {Object.<string,google.cloud.discoveryengine.v1beta.IDoubleList>|null} [modelScores] SearchResult modelScores
|
277354
|
+
* @property {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals|null} [rankSignals] SearchResult rankSignals
|
275658
277355
|
*/
|
275659
277356
|
|
275660
277357
|
/**
|
@@ -275705,6 +277402,14 @@
|
|
275705
277402
|
*/
|
275706
277403
|
SearchResult.prototype.modelScores = $util.emptyObject;
|
275707
277404
|
|
277405
|
+
/**
|
277406
|
+
* SearchResult rankSignals.
|
277407
|
+
* @member {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals|null|undefined} rankSignals
|
277408
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult
|
277409
|
+
* @instance
|
277410
|
+
*/
|
277411
|
+
SearchResult.prototype.rankSignals = null;
|
277412
|
+
|
275708
277413
|
/**
|
275709
277414
|
* Creates a new SearchResult instance using the specified properties.
|
275710
277415
|
* @function create
|
@@ -275738,6 +277443,8 @@
|
|
275738
277443
|
writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
|
275739
277444
|
$root.google.cloud.discoveryengine.v1beta.DoubleList.encode(message.modelScores[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
|
275740
277445
|
}
|
277446
|
+
if (message.rankSignals != null && Object.hasOwnProperty.call(message, "rankSignals"))
|
277447
|
+
$root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.encode(message.rankSignals, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
275741
277448
|
if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk"))
|
275742
277449
|
$root.google.cloud.discoveryengine.v1beta.Chunk.encode(message.chunk, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim();
|
275743
277450
|
return writer;
|
@@ -275811,6 +277518,10 @@
|
|
275811
277518
|
message.modelScores[key] = value;
|
275812
277519
|
break;
|
275813
277520
|
}
|
277521
|
+
case 7: {
|
277522
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.decode(reader, reader.uint32());
|
277523
|
+
break;
|
277524
|
+
}
|
275814
277525
|
default:
|
275815
277526
|
reader.skipType(tag & 7);
|
275816
277527
|
break;
|
@@ -275869,6 +277580,11 @@
|
|
275869
277580
|
return "modelScores." + error;
|
275870
277581
|
}
|
275871
277582
|
}
|
277583
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals")) {
|
277584
|
+
var error = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.verify(message.rankSignals);
|
277585
|
+
if (error)
|
277586
|
+
return "rankSignals." + error;
|
277587
|
+
}
|
275872
277588
|
return null;
|
275873
277589
|
};
|
275874
277590
|
|
@@ -275906,6 +277622,11 @@
|
|
275906
277622
|
message.modelScores[keys[i]] = $root.google.cloud.discoveryengine.v1beta.DoubleList.fromObject(object.modelScores[keys[i]]);
|
275907
277623
|
}
|
275908
277624
|
}
|
277625
|
+
if (object.rankSignals != null) {
|
277626
|
+
if (typeof object.rankSignals !== "object")
|
277627
|
+
throw TypeError(".google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.rankSignals: object expected");
|
277628
|
+
message.rankSignals = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.fromObject(object.rankSignals);
|
277629
|
+
}
|
275909
277630
|
return message;
|
275910
277631
|
};
|
275911
277632
|
|
@@ -275927,6 +277648,7 @@
|
|
275927
277648
|
if (options.defaults) {
|
275928
277649
|
object.id = "";
|
275929
277650
|
object.document = null;
|
277651
|
+
object.rankSignals = null;
|
275930
277652
|
object.chunk = null;
|
275931
277653
|
}
|
275932
277654
|
if (message.id != null && message.hasOwnProperty("id"))
|
@@ -275939,6 +277661,8 @@
|
|
275939
277661
|
for (var j = 0; j < keys2.length; ++j)
|
275940
277662
|
object.modelScores[keys2[j]] = $root.google.cloud.discoveryengine.v1beta.DoubleList.toObject(message.modelScores[keys2[j]], options);
|
275941
277663
|
}
|
277664
|
+
if (message.rankSignals != null && message.hasOwnProperty("rankSignals"))
|
277665
|
+
object.rankSignals = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.toObject(message.rankSignals, options);
|
275942
277666
|
if (message.chunk != null && message.hasOwnProperty("chunk"))
|
275943
277667
|
object.chunk = $root.google.cloud.discoveryengine.v1beta.Chunk.toObject(message.chunk, options);
|
275944
277668
|
return object;
|
@@ -275970,6 +277694,720 @@
|
|
275970
277694
|
return typeUrlPrefix + "/google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult";
|
275971
277695
|
};
|
275972
277696
|
|
277697
|
+
SearchResult.RankSignals = (function() {
|
277698
|
+
|
277699
|
+
/**
|
277700
|
+
* Properties of a RankSignals.
|
277701
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult
|
277702
|
+
* @interface IRankSignals
|
277703
|
+
* @property {number|null} [keywordSimilarityScore] RankSignals keywordSimilarityScore
|
277704
|
+
* @property {number|null} [relevanceScore] RankSignals relevanceScore
|
277705
|
+
* @property {number|null} [semanticSimilarityScore] RankSignals semanticSimilarityScore
|
277706
|
+
* @property {number|null} [pctrRank] RankSignals pctrRank
|
277707
|
+
* @property {number|null} [topicalityRank] RankSignals topicalityRank
|
277708
|
+
* @property {number|null} [documentAge] RankSignals documentAge
|
277709
|
+
* @property {number|null} [boostingFactor] RankSignals boostingFactor
|
277710
|
+
* @property {number|null} [defaultRank] RankSignals defaultRank
|
277711
|
+
* @property {Array.<google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal>|null} [customSignals] RankSignals customSignals
|
277712
|
+
*/
|
277713
|
+
|
277714
|
+
/**
|
277715
|
+
* Constructs a new RankSignals.
|
277716
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult
|
277717
|
+
* @classdesc Represents a RankSignals.
|
277718
|
+
* @implements IRankSignals
|
277719
|
+
* @constructor
|
277720
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
277721
|
+
*/
|
277722
|
+
function RankSignals(properties) {
|
277723
|
+
this.customSignals = [];
|
277724
|
+
if (properties)
|
277725
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
277726
|
+
if (properties[keys[i]] != null)
|
277727
|
+
this[keys[i]] = properties[keys[i]];
|
277728
|
+
}
|
277729
|
+
|
277730
|
+
/**
|
277731
|
+
* RankSignals keywordSimilarityScore.
|
277732
|
+
* @member {number|null|undefined} keywordSimilarityScore
|
277733
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277734
|
+
* @instance
|
277735
|
+
*/
|
277736
|
+
RankSignals.prototype.keywordSimilarityScore = null;
|
277737
|
+
|
277738
|
+
/**
|
277739
|
+
* RankSignals relevanceScore.
|
277740
|
+
* @member {number|null|undefined} relevanceScore
|
277741
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277742
|
+
* @instance
|
277743
|
+
*/
|
277744
|
+
RankSignals.prototype.relevanceScore = null;
|
277745
|
+
|
277746
|
+
/**
|
277747
|
+
* RankSignals semanticSimilarityScore.
|
277748
|
+
* @member {number|null|undefined} semanticSimilarityScore
|
277749
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277750
|
+
* @instance
|
277751
|
+
*/
|
277752
|
+
RankSignals.prototype.semanticSimilarityScore = null;
|
277753
|
+
|
277754
|
+
/**
|
277755
|
+
* RankSignals pctrRank.
|
277756
|
+
* @member {number|null|undefined} pctrRank
|
277757
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277758
|
+
* @instance
|
277759
|
+
*/
|
277760
|
+
RankSignals.prototype.pctrRank = null;
|
277761
|
+
|
277762
|
+
/**
|
277763
|
+
* RankSignals topicalityRank.
|
277764
|
+
* @member {number|null|undefined} topicalityRank
|
277765
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277766
|
+
* @instance
|
277767
|
+
*/
|
277768
|
+
RankSignals.prototype.topicalityRank = null;
|
277769
|
+
|
277770
|
+
/**
|
277771
|
+
* RankSignals documentAge.
|
277772
|
+
* @member {number|null|undefined} documentAge
|
277773
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277774
|
+
* @instance
|
277775
|
+
*/
|
277776
|
+
RankSignals.prototype.documentAge = null;
|
277777
|
+
|
277778
|
+
/**
|
277779
|
+
* RankSignals boostingFactor.
|
277780
|
+
* @member {number|null|undefined} boostingFactor
|
277781
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277782
|
+
* @instance
|
277783
|
+
*/
|
277784
|
+
RankSignals.prototype.boostingFactor = null;
|
277785
|
+
|
277786
|
+
/**
|
277787
|
+
* RankSignals defaultRank.
|
277788
|
+
* @member {number} defaultRank
|
277789
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277790
|
+
* @instance
|
277791
|
+
*/
|
277792
|
+
RankSignals.prototype.defaultRank = 0;
|
277793
|
+
|
277794
|
+
/**
|
277795
|
+
* RankSignals customSignals.
|
277796
|
+
* @member {Array.<google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal>} customSignals
|
277797
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277798
|
+
* @instance
|
277799
|
+
*/
|
277800
|
+
RankSignals.prototype.customSignals = $util.emptyArray;
|
277801
|
+
|
277802
|
+
// OneOf field names bound to virtual getters and setters
|
277803
|
+
var $oneOfFields;
|
277804
|
+
|
277805
|
+
// Virtual OneOf for proto3 optional field
|
277806
|
+
Object.defineProperty(RankSignals.prototype, "_keywordSimilarityScore", {
|
277807
|
+
get: $util.oneOfGetter($oneOfFields = ["keywordSimilarityScore"]),
|
277808
|
+
set: $util.oneOfSetter($oneOfFields)
|
277809
|
+
});
|
277810
|
+
|
277811
|
+
// Virtual OneOf for proto3 optional field
|
277812
|
+
Object.defineProperty(RankSignals.prototype, "_relevanceScore", {
|
277813
|
+
get: $util.oneOfGetter($oneOfFields = ["relevanceScore"]),
|
277814
|
+
set: $util.oneOfSetter($oneOfFields)
|
277815
|
+
});
|
277816
|
+
|
277817
|
+
// Virtual OneOf for proto3 optional field
|
277818
|
+
Object.defineProperty(RankSignals.prototype, "_semanticSimilarityScore", {
|
277819
|
+
get: $util.oneOfGetter($oneOfFields = ["semanticSimilarityScore"]),
|
277820
|
+
set: $util.oneOfSetter($oneOfFields)
|
277821
|
+
});
|
277822
|
+
|
277823
|
+
// Virtual OneOf for proto3 optional field
|
277824
|
+
Object.defineProperty(RankSignals.prototype, "_pctrRank", {
|
277825
|
+
get: $util.oneOfGetter($oneOfFields = ["pctrRank"]),
|
277826
|
+
set: $util.oneOfSetter($oneOfFields)
|
277827
|
+
});
|
277828
|
+
|
277829
|
+
// Virtual OneOf for proto3 optional field
|
277830
|
+
Object.defineProperty(RankSignals.prototype, "_topicalityRank", {
|
277831
|
+
get: $util.oneOfGetter($oneOfFields = ["topicalityRank"]),
|
277832
|
+
set: $util.oneOfSetter($oneOfFields)
|
277833
|
+
});
|
277834
|
+
|
277835
|
+
// Virtual OneOf for proto3 optional field
|
277836
|
+
Object.defineProperty(RankSignals.prototype, "_documentAge", {
|
277837
|
+
get: $util.oneOfGetter($oneOfFields = ["documentAge"]),
|
277838
|
+
set: $util.oneOfSetter($oneOfFields)
|
277839
|
+
});
|
277840
|
+
|
277841
|
+
// Virtual OneOf for proto3 optional field
|
277842
|
+
Object.defineProperty(RankSignals.prototype, "_boostingFactor", {
|
277843
|
+
get: $util.oneOfGetter($oneOfFields = ["boostingFactor"]),
|
277844
|
+
set: $util.oneOfSetter($oneOfFields)
|
277845
|
+
});
|
277846
|
+
|
277847
|
+
/**
|
277848
|
+
* Creates a new RankSignals instance using the specified properties.
|
277849
|
+
* @function create
|
277850
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277851
|
+
* @static
|
277852
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals=} [properties] Properties to set
|
277853
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals} RankSignals instance
|
277854
|
+
*/
|
277855
|
+
RankSignals.create = function create(properties) {
|
277856
|
+
return new RankSignals(properties);
|
277857
|
+
};
|
277858
|
+
|
277859
|
+
/**
|
277860
|
+
* Encodes the specified RankSignals message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
277861
|
+
* @function encode
|
277862
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277863
|
+
* @static
|
277864
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
277865
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
277866
|
+
* @returns {$protobuf.Writer} Writer
|
277867
|
+
*/
|
277868
|
+
RankSignals.encode = function encode(message, writer) {
|
277869
|
+
if (!writer)
|
277870
|
+
writer = $Writer.create();
|
277871
|
+
if (message.keywordSimilarityScore != null && Object.hasOwnProperty.call(message, "keywordSimilarityScore"))
|
277872
|
+
writer.uint32(/* id 1, wireType 5 =*/13).float(message.keywordSimilarityScore);
|
277873
|
+
if (message.relevanceScore != null && Object.hasOwnProperty.call(message, "relevanceScore"))
|
277874
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.relevanceScore);
|
277875
|
+
if (message.semanticSimilarityScore != null && Object.hasOwnProperty.call(message, "semanticSimilarityScore"))
|
277876
|
+
writer.uint32(/* id 3, wireType 5 =*/29).float(message.semanticSimilarityScore);
|
277877
|
+
if (message.pctrRank != null && Object.hasOwnProperty.call(message, "pctrRank"))
|
277878
|
+
writer.uint32(/* id 4, wireType 5 =*/37).float(message.pctrRank);
|
277879
|
+
if (message.topicalityRank != null && Object.hasOwnProperty.call(message, "topicalityRank"))
|
277880
|
+
writer.uint32(/* id 6, wireType 5 =*/53).float(message.topicalityRank);
|
277881
|
+
if (message.documentAge != null && Object.hasOwnProperty.call(message, "documentAge"))
|
277882
|
+
writer.uint32(/* id 7, wireType 5 =*/61).float(message.documentAge);
|
277883
|
+
if (message.boostingFactor != null && Object.hasOwnProperty.call(message, "boostingFactor"))
|
277884
|
+
writer.uint32(/* id 8, wireType 5 =*/69).float(message.boostingFactor);
|
277885
|
+
if (message.defaultRank != null && Object.hasOwnProperty.call(message, "defaultRank"))
|
277886
|
+
writer.uint32(/* id 32, wireType 5 =*/261).float(message.defaultRank);
|
277887
|
+
if (message.customSignals != null && message.customSignals.length)
|
277888
|
+
for (var i = 0; i < message.customSignals.length; ++i)
|
277889
|
+
$root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.encode(message.customSignals[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim();
|
277890
|
+
return writer;
|
277891
|
+
};
|
277892
|
+
|
277893
|
+
/**
|
277894
|
+
* Encodes the specified RankSignals message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.verify|verify} messages.
|
277895
|
+
* @function encodeDelimited
|
277896
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277897
|
+
* @static
|
277898
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.IRankSignals} message RankSignals message or plain object to encode
|
277899
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
277900
|
+
* @returns {$protobuf.Writer} Writer
|
277901
|
+
*/
|
277902
|
+
RankSignals.encodeDelimited = function encodeDelimited(message, writer) {
|
277903
|
+
return this.encode(message, writer).ldelim();
|
277904
|
+
};
|
277905
|
+
|
277906
|
+
/**
|
277907
|
+
* Decodes a RankSignals message from the specified reader or buffer.
|
277908
|
+
* @function decode
|
277909
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277910
|
+
* @static
|
277911
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
277912
|
+
* @param {number} [length] Message length if known beforehand
|
277913
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals} RankSignals
|
277914
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
277915
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
277916
|
+
*/
|
277917
|
+
RankSignals.decode = function decode(reader, length, error) {
|
277918
|
+
if (!(reader instanceof $Reader))
|
277919
|
+
reader = $Reader.create(reader);
|
277920
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals();
|
277921
|
+
while (reader.pos < end) {
|
277922
|
+
var tag = reader.uint32();
|
277923
|
+
if (tag === error)
|
277924
|
+
break;
|
277925
|
+
switch (tag >>> 3) {
|
277926
|
+
case 1: {
|
277927
|
+
message.keywordSimilarityScore = reader.float();
|
277928
|
+
break;
|
277929
|
+
}
|
277930
|
+
case 2: {
|
277931
|
+
message.relevanceScore = reader.float();
|
277932
|
+
break;
|
277933
|
+
}
|
277934
|
+
case 3: {
|
277935
|
+
message.semanticSimilarityScore = reader.float();
|
277936
|
+
break;
|
277937
|
+
}
|
277938
|
+
case 4: {
|
277939
|
+
message.pctrRank = reader.float();
|
277940
|
+
break;
|
277941
|
+
}
|
277942
|
+
case 6: {
|
277943
|
+
message.topicalityRank = reader.float();
|
277944
|
+
break;
|
277945
|
+
}
|
277946
|
+
case 7: {
|
277947
|
+
message.documentAge = reader.float();
|
277948
|
+
break;
|
277949
|
+
}
|
277950
|
+
case 8: {
|
277951
|
+
message.boostingFactor = reader.float();
|
277952
|
+
break;
|
277953
|
+
}
|
277954
|
+
case 32: {
|
277955
|
+
message.defaultRank = reader.float();
|
277956
|
+
break;
|
277957
|
+
}
|
277958
|
+
case 33: {
|
277959
|
+
if (!(message.customSignals && message.customSignals.length))
|
277960
|
+
message.customSignals = [];
|
277961
|
+
message.customSignals.push($root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.decode(reader, reader.uint32()));
|
277962
|
+
break;
|
277963
|
+
}
|
277964
|
+
default:
|
277965
|
+
reader.skipType(tag & 7);
|
277966
|
+
break;
|
277967
|
+
}
|
277968
|
+
}
|
277969
|
+
return message;
|
277970
|
+
};
|
277971
|
+
|
277972
|
+
/**
|
277973
|
+
* Decodes a RankSignals message from the specified reader or buffer, length delimited.
|
277974
|
+
* @function decodeDelimited
|
277975
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277976
|
+
* @static
|
277977
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
277978
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals} RankSignals
|
277979
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
277980
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
277981
|
+
*/
|
277982
|
+
RankSignals.decodeDelimited = function decodeDelimited(reader) {
|
277983
|
+
if (!(reader instanceof $Reader))
|
277984
|
+
reader = new $Reader(reader);
|
277985
|
+
return this.decode(reader, reader.uint32());
|
277986
|
+
};
|
277987
|
+
|
277988
|
+
/**
|
277989
|
+
* Verifies a RankSignals message.
|
277990
|
+
* @function verify
|
277991
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
277992
|
+
* @static
|
277993
|
+
* @param {Object.<string,*>} message Plain object to verify
|
277994
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
277995
|
+
*/
|
277996
|
+
RankSignals.verify = function verify(message) {
|
277997
|
+
if (typeof message !== "object" || message === null)
|
277998
|
+
return "object expected";
|
277999
|
+
var properties = {};
|
278000
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
278001
|
+
properties._keywordSimilarityScore = 1;
|
278002
|
+
if (typeof message.keywordSimilarityScore !== "number")
|
278003
|
+
return "keywordSimilarityScore: number expected";
|
278004
|
+
}
|
278005
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
278006
|
+
properties._relevanceScore = 1;
|
278007
|
+
if (typeof message.relevanceScore !== "number")
|
278008
|
+
return "relevanceScore: number expected";
|
278009
|
+
}
|
278010
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
278011
|
+
properties._semanticSimilarityScore = 1;
|
278012
|
+
if (typeof message.semanticSimilarityScore !== "number")
|
278013
|
+
return "semanticSimilarityScore: number expected";
|
278014
|
+
}
|
278015
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
278016
|
+
properties._pctrRank = 1;
|
278017
|
+
if (typeof message.pctrRank !== "number")
|
278018
|
+
return "pctrRank: number expected";
|
278019
|
+
}
|
278020
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
278021
|
+
properties._topicalityRank = 1;
|
278022
|
+
if (typeof message.topicalityRank !== "number")
|
278023
|
+
return "topicalityRank: number expected";
|
278024
|
+
}
|
278025
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
278026
|
+
properties._documentAge = 1;
|
278027
|
+
if (typeof message.documentAge !== "number")
|
278028
|
+
return "documentAge: number expected";
|
278029
|
+
}
|
278030
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
278031
|
+
properties._boostingFactor = 1;
|
278032
|
+
if (typeof message.boostingFactor !== "number")
|
278033
|
+
return "boostingFactor: number expected";
|
278034
|
+
}
|
278035
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
278036
|
+
if (typeof message.defaultRank !== "number")
|
278037
|
+
return "defaultRank: number expected";
|
278038
|
+
if (message.customSignals != null && message.hasOwnProperty("customSignals")) {
|
278039
|
+
if (!Array.isArray(message.customSignals))
|
278040
|
+
return "customSignals: array expected";
|
278041
|
+
for (var i = 0; i < message.customSignals.length; ++i) {
|
278042
|
+
var error = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.verify(message.customSignals[i]);
|
278043
|
+
if (error)
|
278044
|
+
return "customSignals." + error;
|
278045
|
+
}
|
278046
|
+
}
|
278047
|
+
return null;
|
278048
|
+
};
|
278049
|
+
|
278050
|
+
/**
|
278051
|
+
* Creates a RankSignals message from a plain object. Also converts values to their respective internal types.
|
278052
|
+
* @function fromObject
|
278053
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278054
|
+
* @static
|
278055
|
+
* @param {Object.<string,*>} object Plain object
|
278056
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals} RankSignals
|
278057
|
+
*/
|
278058
|
+
RankSignals.fromObject = function fromObject(object) {
|
278059
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals)
|
278060
|
+
return object;
|
278061
|
+
var message = new $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals();
|
278062
|
+
if (object.keywordSimilarityScore != null)
|
278063
|
+
message.keywordSimilarityScore = Number(object.keywordSimilarityScore);
|
278064
|
+
if (object.relevanceScore != null)
|
278065
|
+
message.relevanceScore = Number(object.relevanceScore);
|
278066
|
+
if (object.semanticSimilarityScore != null)
|
278067
|
+
message.semanticSimilarityScore = Number(object.semanticSimilarityScore);
|
278068
|
+
if (object.pctrRank != null)
|
278069
|
+
message.pctrRank = Number(object.pctrRank);
|
278070
|
+
if (object.topicalityRank != null)
|
278071
|
+
message.topicalityRank = Number(object.topicalityRank);
|
278072
|
+
if (object.documentAge != null)
|
278073
|
+
message.documentAge = Number(object.documentAge);
|
278074
|
+
if (object.boostingFactor != null)
|
278075
|
+
message.boostingFactor = Number(object.boostingFactor);
|
278076
|
+
if (object.defaultRank != null)
|
278077
|
+
message.defaultRank = Number(object.defaultRank);
|
278078
|
+
if (object.customSignals) {
|
278079
|
+
if (!Array.isArray(object.customSignals))
|
278080
|
+
throw TypeError(".google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.customSignals: array expected");
|
278081
|
+
message.customSignals = [];
|
278082
|
+
for (var i = 0; i < object.customSignals.length; ++i) {
|
278083
|
+
if (typeof object.customSignals[i] !== "object")
|
278084
|
+
throw TypeError(".google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.customSignals: object expected");
|
278085
|
+
message.customSignals[i] = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.fromObject(object.customSignals[i]);
|
278086
|
+
}
|
278087
|
+
}
|
278088
|
+
return message;
|
278089
|
+
};
|
278090
|
+
|
278091
|
+
/**
|
278092
|
+
* Creates a plain object from a RankSignals message. Also converts values to other types if specified.
|
278093
|
+
* @function toObject
|
278094
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278095
|
+
* @static
|
278096
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals} message RankSignals
|
278097
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
278098
|
+
* @returns {Object.<string,*>} Plain object
|
278099
|
+
*/
|
278100
|
+
RankSignals.toObject = function toObject(message, options) {
|
278101
|
+
if (!options)
|
278102
|
+
options = {};
|
278103
|
+
var object = {};
|
278104
|
+
if (options.arrays || options.defaults)
|
278105
|
+
object.customSignals = [];
|
278106
|
+
if (options.defaults)
|
278107
|
+
object.defaultRank = 0;
|
278108
|
+
if (message.keywordSimilarityScore != null && message.hasOwnProperty("keywordSimilarityScore")) {
|
278109
|
+
object.keywordSimilarityScore = options.json && !isFinite(message.keywordSimilarityScore) ? String(message.keywordSimilarityScore) : message.keywordSimilarityScore;
|
278110
|
+
if (options.oneofs)
|
278111
|
+
object._keywordSimilarityScore = "keywordSimilarityScore";
|
278112
|
+
}
|
278113
|
+
if (message.relevanceScore != null && message.hasOwnProperty("relevanceScore")) {
|
278114
|
+
object.relevanceScore = options.json && !isFinite(message.relevanceScore) ? String(message.relevanceScore) : message.relevanceScore;
|
278115
|
+
if (options.oneofs)
|
278116
|
+
object._relevanceScore = "relevanceScore";
|
278117
|
+
}
|
278118
|
+
if (message.semanticSimilarityScore != null && message.hasOwnProperty("semanticSimilarityScore")) {
|
278119
|
+
object.semanticSimilarityScore = options.json && !isFinite(message.semanticSimilarityScore) ? String(message.semanticSimilarityScore) : message.semanticSimilarityScore;
|
278120
|
+
if (options.oneofs)
|
278121
|
+
object._semanticSimilarityScore = "semanticSimilarityScore";
|
278122
|
+
}
|
278123
|
+
if (message.pctrRank != null && message.hasOwnProperty("pctrRank")) {
|
278124
|
+
object.pctrRank = options.json && !isFinite(message.pctrRank) ? String(message.pctrRank) : message.pctrRank;
|
278125
|
+
if (options.oneofs)
|
278126
|
+
object._pctrRank = "pctrRank";
|
278127
|
+
}
|
278128
|
+
if (message.topicalityRank != null && message.hasOwnProperty("topicalityRank")) {
|
278129
|
+
object.topicalityRank = options.json && !isFinite(message.topicalityRank) ? String(message.topicalityRank) : message.topicalityRank;
|
278130
|
+
if (options.oneofs)
|
278131
|
+
object._topicalityRank = "topicalityRank";
|
278132
|
+
}
|
278133
|
+
if (message.documentAge != null && message.hasOwnProperty("documentAge")) {
|
278134
|
+
object.documentAge = options.json && !isFinite(message.documentAge) ? String(message.documentAge) : message.documentAge;
|
278135
|
+
if (options.oneofs)
|
278136
|
+
object._documentAge = "documentAge";
|
278137
|
+
}
|
278138
|
+
if (message.boostingFactor != null && message.hasOwnProperty("boostingFactor")) {
|
278139
|
+
object.boostingFactor = options.json && !isFinite(message.boostingFactor) ? String(message.boostingFactor) : message.boostingFactor;
|
278140
|
+
if (options.oneofs)
|
278141
|
+
object._boostingFactor = "boostingFactor";
|
278142
|
+
}
|
278143
|
+
if (message.defaultRank != null && message.hasOwnProperty("defaultRank"))
|
278144
|
+
object.defaultRank = options.json && !isFinite(message.defaultRank) ? String(message.defaultRank) : message.defaultRank;
|
278145
|
+
if (message.customSignals && message.customSignals.length) {
|
278146
|
+
object.customSignals = [];
|
278147
|
+
for (var j = 0; j < message.customSignals.length; ++j)
|
278148
|
+
object.customSignals[j] = $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.toObject(message.customSignals[j], options);
|
278149
|
+
}
|
278150
|
+
return object;
|
278151
|
+
};
|
278152
|
+
|
278153
|
+
/**
|
278154
|
+
* Converts this RankSignals to JSON.
|
278155
|
+
* @function toJSON
|
278156
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278157
|
+
* @instance
|
278158
|
+
* @returns {Object.<string,*>} JSON object
|
278159
|
+
*/
|
278160
|
+
RankSignals.prototype.toJSON = function toJSON() {
|
278161
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
278162
|
+
};
|
278163
|
+
|
278164
|
+
/**
|
278165
|
+
* Gets the default type url for RankSignals
|
278166
|
+
* @function getTypeUrl
|
278167
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278168
|
+
* @static
|
278169
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
278170
|
+
* @returns {string} The default type url
|
278171
|
+
*/
|
278172
|
+
RankSignals.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
278173
|
+
if (typeUrlPrefix === undefined) {
|
278174
|
+
typeUrlPrefix = "type.googleapis.com";
|
278175
|
+
}
|
278176
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals";
|
278177
|
+
};
|
278178
|
+
|
278179
|
+
RankSignals.CustomSignal = (function() {
|
278180
|
+
|
278181
|
+
/**
|
278182
|
+
* Properties of a CustomSignal.
|
278183
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278184
|
+
* @interface ICustomSignal
|
278185
|
+
* @property {string|null} [name] CustomSignal name
|
278186
|
+
* @property {number|null} [value] CustomSignal value
|
278187
|
+
*/
|
278188
|
+
|
278189
|
+
/**
|
278190
|
+
* Constructs a new CustomSignal.
|
278191
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals
|
278192
|
+
* @classdesc Represents a CustomSignal.
|
278193
|
+
* @implements ICustomSignal
|
278194
|
+
* @constructor
|
278195
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
278196
|
+
*/
|
278197
|
+
function CustomSignal(properties) {
|
278198
|
+
if (properties)
|
278199
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
278200
|
+
if (properties[keys[i]] != null)
|
278201
|
+
this[keys[i]] = properties[keys[i]];
|
278202
|
+
}
|
278203
|
+
|
278204
|
+
/**
|
278205
|
+
* CustomSignal name.
|
278206
|
+
* @member {string} name
|
278207
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278208
|
+
* @instance
|
278209
|
+
*/
|
278210
|
+
CustomSignal.prototype.name = "";
|
278211
|
+
|
278212
|
+
/**
|
278213
|
+
* CustomSignal value.
|
278214
|
+
* @member {number} value
|
278215
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278216
|
+
* @instance
|
278217
|
+
*/
|
278218
|
+
CustomSignal.prototype.value = 0;
|
278219
|
+
|
278220
|
+
/**
|
278221
|
+
* Creates a new CustomSignal instance using the specified properties.
|
278222
|
+
* @function create
|
278223
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278224
|
+
* @static
|
278225
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal=} [properties] Properties to set
|
278226
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal instance
|
278227
|
+
*/
|
278228
|
+
CustomSignal.create = function create(properties) {
|
278229
|
+
return new CustomSignal(properties);
|
278230
|
+
};
|
278231
|
+
|
278232
|
+
/**
|
278233
|
+
* Encodes the specified CustomSignal message. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
278234
|
+
* @function encode
|
278235
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278236
|
+
* @static
|
278237
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
278238
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
278239
|
+
* @returns {$protobuf.Writer} Writer
|
278240
|
+
*/
|
278241
|
+
CustomSignal.encode = function encode(message, writer) {
|
278242
|
+
if (!writer)
|
278243
|
+
writer = $Writer.create();
|
278244
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
278245
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
278246
|
+
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
278247
|
+
writer.uint32(/* id 2, wireType 5 =*/21).float(message.value);
|
278248
|
+
return writer;
|
278249
|
+
};
|
278250
|
+
|
278251
|
+
/**
|
278252
|
+
* Encodes the specified CustomSignal message, length delimited. Does not implicitly {@link google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal.verify|verify} messages.
|
278253
|
+
* @function encodeDelimited
|
278254
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278255
|
+
* @static
|
278256
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.ICustomSignal} message CustomSignal message or plain object to encode
|
278257
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
278258
|
+
* @returns {$protobuf.Writer} Writer
|
278259
|
+
*/
|
278260
|
+
CustomSignal.encodeDelimited = function encodeDelimited(message, writer) {
|
278261
|
+
return this.encode(message, writer).ldelim();
|
278262
|
+
};
|
278263
|
+
|
278264
|
+
/**
|
278265
|
+
* Decodes a CustomSignal message from the specified reader or buffer.
|
278266
|
+
* @function decode
|
278267
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278268
|
+
* @static
|
278269
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
278270
|
+
* @param {number} [length] Message length if known beforehand
|
278271
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
278272
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
278273
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
278274
|
+
*/
|
278275
|
+
CustomSignal.decode = function decode(reader, length, error) {
|
278276
|
+
if (!(reader instanceof $Reader))
|
278277
|
+
reader = $Reader.create(reader);
|
278278
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
278279
|
+
while (reader.pos < end) {
|
278280
|
+
var tag = reader.uint32();
|
278281
|
+
if (tag === error)
|
278282
|
+
break;
|
278283
|
+
switch (tag >>> 3) {
|
278284
|
+
case 1: {
|
278285
|
+
message.name = reader.string();
|
278286
|
+
break;
|
278287
|
+
}
|
278288
|
+
case 2: {
|
278289
|
+
message.value = reader.float();
|
278290
|
+
break;
|
278291
|
+
}
|
278292
|
+
default:
|
278293
|
+
reader.skipType(tag & 7);
|
278294
|
+
break;
|
278295
|
+
}
|
278296
|
+
}
|
278297
|
+
return message;
|
278298
|
+
};
|
278299
|
+
|
278300
|
+
/**
|
278301
|
+
* Decodes a CustomSignal message from the specified reader or buffer, length delimited.
|
278302
|
+
* @function decodeDelimited
|
278303
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278304
|
+
* @static
|
278305
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
278306
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
278307
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
278308
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
278309
|
+
*/
|
278310
|
+
CustomSignal.decodeDelimited = function decodeDelimited(reader) {
|
278311
|
+
if (!(reader instanceof $Reader))
|
278312
|
+
reader = new $Reader(reader);
|
278313
|
+
return this.decode(reader, reader.uint32());
|
278314
|
+
};
|
278315
|
+
|
278316
|
+
/**
|
278317
|
+
* Verifies a CustomSignal message.
|
278318
|
+
* @function verify
|
278319
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278320
|
+
* @static
|
278321
|
+
* @param {Object.<string,*>} message Plain object to verify
|
278322
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
278323
|
+
*/
|
278324
|
+
CustomSignal.verify = function verify(message) {
|
278325
|
+
if (typeof message !== "object" || message === null)
|
278326
|
+
return "object expected";
|
278327
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
278328
|
+
if (!$util.isString(message.name))
|
278329
|
+
return "name: string expected";
|
278330
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
278331
|
+
if (typeof message.value !== "number")
|
278332
|
+
return "value: number expected";
|
278333
|
+
return null;
|
278334
|
+
};
|
278335
|
+
|
278336
|
+
/**
|
278337
|
+
* Creates a CustomSignal message from a plain object. Also converts values to their respective internal types.
|
278338
|
+
* @function fromObject
|
278339
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278340
|
+
* @static
|
278341
|
+
* @param {Object.<string,*>} object Plain object
|
278342
|
+
* @returns {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal} CustomSignal
|
278343
|
+
*/
|
278344
|
+
CustomSignal.fromObject = function fromObject(object) {
|
278345
|
+
if (object instanceof $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal)
|
278346
|
+
return object;
|
278347
|
+
var message = new $root.google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal();
|
278348
|
+
if (object.name != null)
|
278349
|
+
message.name = String(object.name);
|
278350
|
+
if (object.value != null)
|
278351
|
+
message.value = Number(object.value);
|
278352
|
+
return message;
|
278353
|
+
};
|
278354
|
+
|
278355
|
+
/**
|
278356
|
+
* Creates a plain object from a CustomSignal message. Also converts values to other types if specified.
|
278357
|
+
* @function toObject
|
278358
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278359
|
+
* @static
|
278360
|
+
* @param {google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal} message CustomSignal
|
278361
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
278362
|
+
* @returns {Object.<string,*>} Plain object
|
278363
|
+
*/
|
278364
|
+
CustomSignal.toObject = function toObject(message, options) {
|
278365
|
+
if (!options)
|
278366
|
+
options = {};
|
278367
|
+
var object = {};
|
278368
|
+
if (options.defaults) {
|
278369
|
+
object.name = "";
|
278370
|
+
object.value = 0;
|
278371
|
+
}
|
278372
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
278373
|
+
object.name = message.name;
|
278374
|
+
if (message.value != null && message.hasOwnProperty("value"))
|
278375
|
+
object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
|
278376
|
+
return object;
|
278377
|
+
};
|
278378
|
+
|
278379
|
+
/**
|
278380
|
+
* Converts this CustomSignal to JSON.
|
278381
|
+
* @function toJSON
|
278382
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278383
|
+
* @instance
|
278384
|
+
* @returns {Object.<string,*>} JSON object
|
278385
|
+
*/
|
278386
|
+
CustomSignal.prototype.toJSON = function toJSON() {
|
278387
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
278388
|
+
};
|
278389
|
+
|
278390
|
+
/**
|
278391
|
+
* Gets the default type url for CustomSignal
|
278392
|
+
* @function getTypeUrl
|
278393
|
+
* @memberof google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal
|
278394
|
+
* @static
|
278395
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
278396
|
+
* @returns {string} The default type url
|
278397
|
+
*/
|
278398
|
+
CustomSignal.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
278399
|
+
if (typeUrlPrefix === undefined) {
|
278400
|
+
typeUrlPrefix = "type.googleapis.com";
|
278401
|
+
}
|
278402
|
+
return typeUrlPrefix + "/google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult.RankSignals.CustomSignal";
|
278403
|
+
};
|
278404
|
+
|
278405
|
+
return CustomSignal;
|
278406
|
+
})();
|
278407
|
+
|
278408
|
+
return RankSignals;
|
278409
|
+
})();
|
278410
|
+
|
275973
278411
|
return SearchResult;
|
275974
278412
|
})();
|
275975
278413
|
|