小编Aru*_*thi的帖子

Elasticsearch关系映射(一对一和一对多)

在我的弹性搜索服务器中,我有一个索引http://localhost:9200/blog.
(博客)索引包含多种类型.

例如:http://localhost:9200/blog/posts,http://localhost:9200/blog/tags.

在标签类型中,我创建了超过1000个标签和10个帖子类型的帖子.

例如:帖子

{   
    "_index":"blog",
    "_type":"posts",
    "_id":"1",
    "_version":3,
    "found":true,
    "_source" : {
        "catalogId" : "1",
       "name" : "cricket",
       "url" : "http://www.wikipedia/cricket"
    }
}
Run Code Online (Sandbox Code Playgroud)

例如:标签

{   
    "_index":"blog",
    "_type":"tags",
    "_id":"1",
    "_version":3,
    "found":true,
    "_source" : {
        "tagId" : "1",
        "name" : "game"
    }
}
Run Code Online (Sandbox Code Playgroud)

我想将现有标签分配给博客帖子(即relationship => mapping).

如何将标签分配给帖子映射?

mapping relationship elasticsearch elastica

25
推荐指数
1
解决办法
1万
查看次数

标签 统计

elastica ×1

elasticsearch ×1

mapping ×1

relationship ×1