Elasticsearch不从索引返回

时间:2015-01-09 12:40:03

标签: elasticsearch

我正在查询我的索引:

GET _search
{
  "query": {
   "match_phrase" : {
     "keywords" : "Apprenticeship"
    }
  }
}

我可以在索引中看到记录在索引中(它返回其他短语)并且Apprenticeship在关键字内。它也会返回plasterer

索引中的其他记录正在返回但不是这个记录,我无法解决原因。

{
  "_source": {
    "id": "1806",
    "keywords": [
      "site manager",
      "construction worker",
      "joiner",
      "carpenter",
      "shop fitter",
      "builder",
      "construction projects",
      "plasterer",
      "decorator",
      "painter",
      "apprentice",
      "apprenticeship",
      "Apprenticeship",
      "Adv Apprenticeship"
    ]
  }
}

还有其他字段,如正文,标题等。

映射:

{
  "coursedir" : {
    "mappings" : {
      "courses" : {
        "properties" : {
          "id" : {
            "type" : "string"
          },
          "interestKeywords" : {
            "type" : "string"
          },
          "keywords" : {
            "type" : "string"
          },
          "moduleentry" : {
            "type" : "string"
          },
          "modulefaculty" : {
            "type" : "string"
          },
          "moduleid" : {
            "type" : "string"
          },
          "moduleintro" : {
            "type" : "string"
          },
          "moduleprogression" : {
            "type" : "string"
          },
          "modulereference" : {
            "type" : "string"
          },
          "modulesite" : {
            "type" : "string"
          },
          "title" : {
            "type" : "string"
          },
          "url_title" : {
            "type" : "string"
          }
        }
      }
    }
  }
}

coursedir设置:

{
  "coursedir" : {
    "settings" : {
      "index" : {
        "creation_date" : "1420800223281",
        "number_of_shards" : "5",
        "uuid" : "yXzkAI_2Tx-CGKfkMusZmw",
        "version" : {
          "created" : "1040299"
        },
        "number_of_replicas" : "1"
      }
    }
  }
}

0 个答案:

没有答案