结构化查询中短语和术语有什么区别?

Kaa*_*rde 11 amazon-web-services amazon-cloudsearch

如何phrase以及term在不同的Structured查询?

我的CloudSearch域中有这些数据:

{
    "guid": 9,
    "operating_systems": [
        "12345", "123"
    ],
    "manufacturer": "sealand",
    "model": "gaming tree whale plum",
    "identifier": "gaming tree whale plum",
    "type": "computer",
    "created_at": "1982-10-14T14:43:54Z"
}
Run Code Online (Sandbox Code Playgroud)

"model"是类型text,"identifier"是类型literal,"created_at"是类型date.

我们来一些问题:

(phrase field=model 'tree whale')                match
(phrase field= identifier 'tree whale')          no match
(phrase 'tree whale')                            match
(phrase field=created_at '1982-10-14T14:43:54Z') match (this shouldn't match according to docs)

(term field=model 'tree whale')                match
(term field= identifier 'tree whale')          no match
(term 'tree whale')                            match
(term field=created_at '1982-10-14T14:43:54Z') match
Run Code Online (Sandbox Code Playgroud)

有什么我可以做的phrase,我不能做,term反之亦然?

Ton*_*cas 1

termVS的语法和用法差别很小phrase。然而,处理中的搜索行为phrases可以通过不能的方式进行定制terms,这可以用来提高性能:

  • 允许的操作员
  • 短语字段
  • 短语倾斜

Terms用于匹配文本字段,其中phrases用于更复杂的搜索。

跳过 Web 文档,只需阅读所有 PDF: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/cloudsearch-dg.pdf