在 Neptune 全文搜索查询中使用 Apache Lucene 查询语法 - Amazon Neptune
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

在 Neptune 全文搜索查询中使用 Apache Lucene 查询语法

OpenSearch 支持使用 Apache Lucene 语法进行 query_string 查询。这对于在查询中传递多个筛选条件特别有用。

Neptune 使用嵌套结构将属性存储在 OpenSearch 文档中(请参阅Neptune 全文搜索数据模型)。使用 Lucene 语法时,需要使用此嵌套模型中属性的完整路径。

以下是一个 Gremlin 示例:

g.withSideEffect("Neptune#fts.endpoint", "es_endpoint") .withSideEffect("Neptune#fts.queryType", "query_string") .V() .has("*", "Neptune#fts predicates.name.value:\"Jane Austin\" AND entity_type:Book")

以下是一个 SPARQL 示例:

PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#> SELECT * WHERE { SERVICE neptune-fts:search { neptune-fts:config neptune-fts:endpoint 'http://localhost:9200 (http://localhost:9200/)' . neptune-fts:config neptune-fts:queryType 'query_string' . neptune-fts:config neptune-fts:query "predicates.\\*foaf\\*name.value:Ronak AND predicates.\\*foaf\\*surname.value:Sh*" . neptune-fts:config neptune-fts:field '*' . neptune-fts:config neptune-fts:return ?res . }