草庐IT

RestHighLevClient

全部标签

ElasticSearch RestHighLevClient之索引、映射操作(一)

RestHighLevelClient创建索引映射@TestpublicvoidtestCreateIndex()throwsIOException{CreateIndexRequestcreateIndexRequest=newCreateIndexRequest("fruit");createIndexRequest.mapping("{\n"+"\"properties\":{\n"+"\"title\":{\n"+"\"type\":\"keyword\"\n"+"},\n"+"\"price\":{\n"+"\"type\":\"double\"\n"+"},\n"+"\"creat