REST Resource: settings.searchapplications

资源:SearchApplication

SearchApplication

JSON 表示法
{
  "name": string,
  "displayName": string,
  "dataSourceRestrictions": [
    {
      object (DataSourceRestriction)
    }
  ],
  "sourceConfig": [
    {
      object (SourceConfig)
    }
  ],
  "scoringConfig": {
    object (ScoringConfig)
  },
  "defaultSortOptions": {
    object (SortOptions)
  },
  "defaultFacetOptions": [
    {
      object (FacetOptions)
    }
  ],
  "returnResultThumbnailUrls": boolean,
  "operationIds": [
    string
  ],
  "enableAuditLog": boolean,
  "queryInterpretationConfig": {
    object (QueryInterpretationConfig)
  }
}
字段
name

string

搜索应用的名称。

格式:searchapplications/{applicationId}。

displayName

string

搜索应用的显示名称。长度上限为 300 个字符。

dataSourceRestrictions[]

object (DataSourceRestriction)

应用于配置的限制。元素数量上限为 10。

sourceConfig[]

object (SourceConfig)

dataSourceRestrictions 中指定的来源的配置。

scoringConfig

object (ScoringConfig)

排名结果的配置。

defaultSortOptions

object (SortOptions)

用于对搜索结果进行排序的默认选项

defaultFacetOptions[]

object (FacetOptions)

用于返回分面结果的默认字段。上述 dataSourceRestrictions 中也包含了此处指定的来源。

returnResultThumbnailUrls

boolean

对于每条结果,我们都应返回其缩略图的 URI(如果适用)

operationIds[]

string

仅限输出。目前针对此架构运行的长时间运行操作 (LRO) 的 ID。仅限输出字段。

enableAuditLog

boolean

指示是否为在查询 API 中针对搜索应用发出的请求启用/停用审核日志记录。

queryInterpretationConfig

object (QueryInterpretationConfig)

查询解释的默认选项

DataSourceRestriction

对数据源的限制。

JSON 表示法
{
  "source": {
    object (Source)
  },
  "filterOptions": [
    {
      object (FilterOptions)
    }
  ]
}
字段
source

object (Source)

限制来源。

filterOptions[]

object (FilterOptions)

用于限制结果的过滤条件选项。如果同时使用了多个过滤条件,系统会先按对象类型对其进行分组,然后再进行联接。具有相同对象类型的过滤条件会联接,然后生成的表达式会析取联接。

元素数量上限为 20。

注意:Suggest API 目前仅支持以下几个过滤条件:“objecttype”“type”和“mimetype”。目前,无法使用特定于架构的过滤条件来过滤建议。

来源

定义建议/搜索 API 的来源。

JSON 表示法
{

  // Union field source can be only one of the following:
  "name": string,
  "predefinedSource": enum (Source.PredefinedSource)
  // End of list of possible types for union field source.
}
字段

联合字段 source

source 只能是下列其中一项:

name

string

Indexing API 编入索引的内容的来源名称。

predefinedSource

enum (Source.PredefinedSource)

Google 应用的预定义内容来源。

Source.PredefinedSource

预定义来源:

枚举
NONE
QUERY_HISTORY 建议用户过去发出的查询。仅在与 suggest API 搭配使用时有效。在查询 API 中使用时会被忽略。
PERSON 建议贵组织中的用户。仅在与 suggest API 搭配使用时有效。在查询 API 中使用时会导致错误。
GOOGLE_DRIVE
GOOGLE_GMAIL
GOOGLE_SITES
GOOGLE_GROUPS
GOOGLE_CALENDAR
GOOGLE_KEEP

FilterOptions

要应用于查询的过滤条件选项。

JSON 表示法
{
  "objectType": string,
  "filter": {
    object (Filter)
  }
}
字段
objectType

string

如果设置了 objectType,则仅返回该类型的对象。这应与架构定义中注册的对象的名称相对应。长度上限为 256 个字符。

filter

object (Filter)

用于限制搜索的通用过滤条件,例如 lang:ensite:xyz

过滤

在查询中表达过滤条件的通用方法,支持两种方法:

1. 设置 ValueFilter。该名称必须与数据源架构中定义的 operatorName 一致。

2. 设置 CompositeFilter。系统会使用逻辑运算符对过滤条件进行求值。顶级运算符只能是 AND 或 NOT。AND 只能出现在顶级。OR 只能位于顶级 AND 下。

JSON 表示法
{

  // Union field filter can be only one of the following:
  "valueFilter": {
    object (Filter.ValueFilter)
  },
  "compositeFilter": {
    object (Filter.CompositeFilter)
  }
  // End of list of possible types for union field filter.
}
字段

联合字段 filter

filter 只能是下列其中一项:

valueFilter

object (Filter.ValueFilter)

compositeFilter

object (Filter.CompositeFilter)

Filter.ValueFilter

JSON 表示法
{
  "operatorName": string,
  "value": {
    object (Value)
  }
}
字段
operatorName

string

应用于查询的 operatorName,例如 price_greater_than。该过滤器可针对数据源架构中定义的两种过滤器类型进行过滤:

  1. operatorName,其中查询会按与值匹配的属性过滤结果。

  2. 架构中使用 greaterThanOperatorNamelessThanOperatorName。该查询会过滤大于或小于查询中所提供值的房源值。

value

object (Value)

要与之进行比较的值。

具有通用类型的单个值的定义。

JSON 表示法
{

  // Union field value can be only one of the following:
  "stringValue": string,
  "integerValue": string,
  "doubleValue": number,
  "timestampValue": string,
  "booleanValue": boolean,
  "dateValue": {
    object (Date)
  }
  // End of list of possible types for union field value.
}
字段
联合字段 value。命名属性的值。value 只能是下列其中一项:
stringValue

string

integerValue

string (int64 format)

doubleValue

number

timestampValue

string (Timestamp format)

时间戳采用 RFC3339 世界协调时间(UTC,即“祖鲁时”)格式,精确到纳秒,最多九个小数位。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z"

booleanValue

boolean

dateValue

object (Date)

Filter.CompositeFilter

JSON 表示法
{
  "logicOperator": enum (Filter.CompositeFilter.LogicOperator),
  "subFilters": [
    {
      object (Filter)
    }
  ]
}
字段
logicOperator

enum (Filter.CompositeFilter.LogicOperator)

子过滤条件的逻辑运算符。

subFilters[]

object (Filter)

子过滤条件。

Filter.CompositeFilter.LogicOperator

枚举
AND 逻辑运算符,只能应用于子过滤条件。
OR
NOT 非运算只能应用于单个子过滤条件。

SourceConfig

处理 query.searchquery.suggest 请求时,来源的配置。

JSON 表示法
{
  "source": {
    object (Source)
  },
  "scoringConfig": {
    object (SourceScoringConfig)
  },
  "crowdingConfig": {
    object (SourceCrowdingConfig)
  }
}
字段
source

object (Source)

要使用此配置的来源。

scoringConfig

object (SourceScoringConfig)

来源的评分配置。

crowdingConfig

object (SourceCrowdingConfig)

来源的拥挤配置。

SourceScoringConfig

设置评分配置。这样,您就可以修改来源的结果排名。

JSON 表示法
{
  "sourceImportance": enum (SourceScoringConfig.SourceImportance)
}
字段
sourceImportance

enum (SourceScoringConfig.SourceImportance)

来源的重要性。

SourceScoringConfig.SourceImportance

来源的重要性,可用于指明某个来源在排名中是否应比另一个来源更优先。

枚举
DEFAULT
LOW
HIGH

SourceCrowdingConfig

设置搜索结果数量上限。拥挤是指来自同一来源或托管服务的多个结果“挤占”了其他结果,从而降低了用户的搜索体验质量。为了提高搜索结果的质量并增加来源多样性,您可以设置条件,以按来源减少重复结果。

JSON 表示法
{
  "numResults": integer,
  "numSuggestions": integer
}
字段
numResults

integer

结果页中允许从数据源获取的结果数量上限(前提是其他来源的结果未用尽)。指定的值不得为负。如果此值等于 0,则使用默认值。如需停用拥挤限制,请将此值设置为大于 100。

numSuggestions

integer

从来源获取的建议数量上限。如果此值小于或等于 0,则不会对结果设置任何限制。

ScoringConfig

在处理 query.searchquery.suggest 请求时,为来源配置评分。

JSON 表示法
{
  "disableFreshness": boolean,
  "disablePersonalization": boolean
}
字段
disableFreshness

boolean

是否将新鲜度作为排名信号。默认情况下,新鲜度会用作排名信号。请注意,此设置不适用于“管理”界面。

disablePersonalization

boolean

是否要对结果进行个性化处理。默认情况下,系统会使用个人信号来提升结果。

SortOptions

JSON 表示法
{
  "operatorName": string,
  "sortOrder": enum (SortOptions.SortOrder)
}
字段
operatorName

string

与要对其进行排序的字段对应的运算符的名称。相应的属性必须标记为 sortable

sortOrder

enum (SortOptions.SortOrder)

升序是默认的排序顺序

SortOptions.SortOrder

枚举
ASCENDING
DESCENDING

FacetOptions

指定要针对哪些运算符返回分面结果。每个 sourceName/objectType/operatorName 组合都会有一个 FacetResult。

JSON 表示法
{
  "sourceName": string,
  "objectType": string,
  "operatorName": string,
  "numFacetBuckets": integer,
  "integerFacetingOptions": {
    object (IntegerFacetingOptions)
  }
}
字段
sourceName

string

要按其进行细分的来源名称。格式:datasources/{sourceId}。如果为空,系统将使用所有数据源。

objectType

string

如果设置了 objectType,则系统只会使用该类型的对象来计算面向。如果为空,则系统会使用所有对象来计算切面。

operatorName

string

为切片选择的运算符的名称。@see cloudsearch.SchemaPropertyOptions

numFacetBuckets

integer

应为此分面返回的分面分桶数量上限。默认值为 10。最大值为 100。

integerFacetingOptions

object (IntegerFacetingOptions)

如果已设置,则描述给定整数属性的整数切面选项。架构中相应的整数属性应标记为 isFacetable。返回的分桶数量将是此值和 numFacetBuckets 中的较小者。

IntegerFacetingOptions

用于指定整数分面选项。

JSON 表示法
{
  "integerBuckets": [
    string
  ]
}
字段
integerBuckets[]

string (Int64Value format)

给定整数值的存储分区应严格按升序排列。例如,如果提供的值为 (1,5,10,100),则系统会构成以下分面分桶:{<1, [1,5), [5-10), [10-100), >=100}。

QueryInterpretationConfig

用于解读用户查询的默认选项。

JSON 表示法
{
  "forceVerbatimMode": boolean,
  "forceDisableSupplementalResults": boolean
}
字段
forceVerbatimMode

boolean

启用此标志可关闭所有内部优化,例如对查询进行自然语言 (NL) 解读、检索补充结果以及使用同义词(包括自定义同义词)。如果此标志设置为 True,则其优先级高于在查询级别设置的选项。如果默认值为 False,查询级标志将为逐字逐句模式设置正确的解释。

forceDisableSupplementalResults

boolean

设置此标志可停用补充结果检索功能,在此处设置标志后,系统将不会为与给定搜索应用关联的查询检索补充结果。如果此标志设置为 True,则其优先级高于在查询级别设置的选项。如果默认值为 False,查询级标志将为补充结果设置正确的解释。

方法

create

创建搜索应用。

delete

删除搜索应用。

get

获取指定的搜索应用。

list

列出所有搜索应用。

patch

更新搜索应用。

reset

将搜索应用重置为默认设置。

update

更新搜索应用。