代码之家  ›  专栏  ›  技术社区  ›  ohwelppp

词组查询的solr语法

  •  0
  • ohwelppp  · 技术社区  · 6 年前

    我有一个定义为:

    "replace-field": {
        "name":"search_words",
        "type":"lowercase",
        "stored":true,
        "indexed": true,
        "multiValued": true
    }
    

    以数组形式包含句子(因此多值:真):

    "id":500
    "search_words":["How much oil should you pour into the engine",
              "How important is engine oil?]
    

    当用户输入短语“发动机机油”时,我应该如何创建一个返回该文档(id=500)的查询? 通过单术语查询,我可以使用 *engine* 它会发现那份文件 engine 在句子的中间,但我找不到一种方法来查找句子中的短语。有没有可能使用Solr?

    1 回复  |  直到 6 年前
        1
  •  3
  •   MatsLindh    6 年前

    text_en

    search_words:"engine oil"