用postman创建索引库

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/caoxuecheng001/article/details/102678609

没有索引库,直接添加索引库和相关信息

url为:http://localhost:9200/blog1       put类型

{
	"mappings":{
		"article":{
			"properties":{
				"id":{
					"type":"long",
					"store":true
					
				},
				"title":{
					"type":"text",
					"store":true,
					"index":true,
					"analyzer":"standard"
				},
				"content":{
					"type":"text",
					"store":true,
					"index":true,
					"analyzer":"standard"
				}
			}
		}
	}
}

这样就创建了一个blog1的索引库,type为article

还可以先创建索引库后,再往里面添加信息

{

		"hello":{
			"properties":{
				"id":{
					"type":"long",
					"store":true
					
				},
				"title":{
					"type":"text",
					"store":true,
					"index":true,
					"analyzer":"standard"
				},
				"content":{
					"type":"text",
					"store":true,
					"index":true,
					"analyzer":"standard"
				}
			}
		}
	
}

url为  http://localhost:9200/blog/hello/_mappings   Post类型

这样和上面的效果一样。

猜你喜欢

转载自blog.csdn.net/caoxuecheng001/article/details/102678609