Elasticsearch中的Field增强与Django-Hays

2024-09-28 22:17:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我们尝试使用Django Haystack 2.1.0和pyelasticsearch 0.6在Elasticsearch中实现字段增强。如果我curl -XGET "http://localhost:9200/_mapping?pretty=true,我会得到一个响应(删除无关部分)

{
  "haystack" : {
    "modelresult" : {
      "_boost" : {
        "name" : "boost",
        "null_value" : 1.0
      },
      "properties" : {
        "headline" : {
          "type" : "string",
          "boost" : 1.5,
          "analyzer" : "snowball",
          "store" : "yes",
          "term_vector" : "with_positions_offsets"
        },
        }
    }
}

到目前为止,我们只是想提高“标题”字段。即使使用像5000这样荒谬的刺激也不会对产出产生影响。我们有什么遗漏吗?在


Tags: djangotruelocalhosthttpprettycurlelasticsearchmapping