Skip to content

Instantly share code, notes, and snippets.

View yanglikun's full-sized avatar
😀

yanglikun yanglikun

😀
View GitHub Profile
@yanglikun
yanglikun / es-分析器
Last active June 27, 2017 02:03
es-分析器
POST /analyzer_index
{
"settings": {
"index": {
"analysis": {
"analyzer":{
"myCustomAnalyzer":{
"type":"custom",
"tokenizer":"myCustomTokenizer",
"filter":["myCustomFilter1","myCustomFilter2"],
@yanglikun
yanglikun / es查询
Created June 19, 2017 11:14
es查询
#match
GET /get-together/event/_search
{
"query": {
"match": {
"title": "hadoop"
}
}
}
#filtered query
@yanglikun
yanglikun / es-query-simple
Created June 16, 2017 13:15
es-query-simple
##search scope
GET /_mapping
#cluster
GET /_search
#specific index
GET /get-together/_search
#specific index and type
GET /get-together/event/_search
#specific type
GET /_all/event/_search
@yanglikun
yanglikun / es查询-book
Created June 16, 2017 02:04
es查询-book
GET _search
{
"query": {
"match_all": {}
}
}
DELETE /test_index
@yanglikun
yanglikun / es-删除
Last active June 15, 2017 13:15
es-删除
DELETE /test_index
GET /test_index/person/_search
GET /test_index/person/_search?version
PUT /test_index/person/1
{
"name":"zhangsan",
"desc":"My name is zhangsan.I live in beijing."
}
DELETE /test_index
PUT /test_index/person/1
{
"name":"zhangsan",
"desc":"My name is zhangsan.I live in beijing."
}
GET /test_index/person/_search
GET /test_index/person/_search?version=true
@yanglikun
yanglikun / es-type定义
Last active June 14, 2017 07:36
es-type定义
DELETE /test_index
PUT /test_index
PUT /test_index/_mapping/book
{
"person": {
"properties": {
"name": {
"type": "string",
"store": "yes"
@yanglikun
yanglikun / es-简单查询
Last active June 14, 2017 07:38
es-simple-query
DELETE /test_index
GET /test_index/person/_search
PUT /test_index/person/1
{
"name":"zhangsan",
"desc":"My name is zhangsan.I live in beijing."
@yanglikun
yanglikun / es-1
Created June 13, 2017 06:45
es刷新配置相关
GET _search
{
"query": {
"match_all": {}
}
}
GET /train/order/_search
GET /train/order/3
package com.jd.train.common;
import java.lang.reflect.Method;
import java.util.ArrayList;
/**
* Created by yanglikun on 2017/6/8.
*/
class A {
public void publicA() {