在 Neptune 全文搜索中筛选哪些字段已编制索引 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

在 Neptune 全文搜索中筛选哪些字段已编制索引

Amazon CloudFormation 模板详细信息中有两个字段可让您指定要从 OpenSearch 索引编制中排除的属性、谓词键或数据类型:

按属性或谓词名称筛选

您可以使用名为 Properties to exclude from being inserted into Elastic Search Index 的可选 Amazon CloudFormation 模板参数,来提供要从 OpenSearch 索引编制中排除的以逗号分隔的属性或谓词键列表。

例如,假设您将此参数设置为 bob

"Properties to exclude from being inserted into Elastic Search Index" : bob

在这种情况下,以下 Gremlin 更新查询的流记录将被删除,而不是进入索引:

g.V("1").property("bob", "test")

同样,您可以将此参数设置为 http://my/example#bob

"Properties to exclude from being inserted into Elastic Search Index" : http://my/example#bob

在这种情况下,以下 SPARQL 更新查询的流记录将被删除,而不是进入索引:

PREFIX ex: <http://my/example#> INSERT DATA { ex:s1 ex:bob "test"}.

如果您未在此 Amazon CloudFormation 模板参数中输入任何内容,则所有未以其它方式排除的属性键都将编制索引。

按属性或谓词值类型筛选

您可以使用名为 Datatypes to exclude from being inserted into Elastic Search Index 的可选 Amazon CloudFormation 模板参数,来提供要从 OpenSearch 索引编制中排除的以逗号分隔的属性或谓词值数据类型列表。

对于 SPARQL,您无需列出完整的 XSD 类型 URI,只需列出数据类型令牌即可。您可以列出的有效数据类型令牌有:

  • string

  • boolean

  • float

  • double

  • dateTime

  • date

  • time

  • byte

  • short

  • int

  • long

  • decimal

  • integer

  • nonNegativeInteger

  • nonPositiveInteger

  • negativeInteger

  • unsignedByte

  • unsignedShort

  • unsignedInt

  • unsignedLong

对于 Gremlin,要列出的有效数据类型有:

  • string

  • date

  • bool

  • byte

  • short

  • int

  • long

  • float

  • double

例如,假设您将此参数设置为 string

"Datatypes to exclude from being inserted into Elastic Search Index" : string

在这种情况下,以下 Gremlin 更新查询的流记录将被删除,而不是进入索引:

g.V("1").property("myStringval", "testvalue")

同样,您可以将此参数设置为 int

"Datatypes to exclude from being inserted into Elastic Search Index" : int

在这种情况下,以下 SPARQL 更新查询的流记录将被删除,而不是进入索引:

PREFIX ex: <http://my/example#> PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> INSERT DATA { ex:s1 ex:bob "11"^^xsd:int }.

如果您未在此 Amazon CloudFormation 模板参数中输入任何内容,则其值可以安全地转换为 OpenSearch 等效值的所有属性都将编制索引。查询语言不支持的列出类型将被忽略。