GET physicsscript/_search
{
"query": {
"match": {
"title": "energy"
}
}
}
#_______________________
#test mapping in small
PUT twitter/_doc/2
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "running very fast loving everything rocks pea"
}
GET /twitter/_search?q='try'
GET /twitter/_mapping/
______________________________
PUT /twitter6
{
"settings": {
"analysis": {
"filter": {
"english_stop": {
"type": "stop",
"stopwords": "_english_"
},
"light_english_stemmer": {
"type": "stemmer",
"language": "light_english"
},
"english_possessive_stemmer": {
"type": "stemmer",
"language": "possessive_english"
}
},
"analyzer": {
"english2": {
"tokenizer": "standard",
"filter": [
"english_possessive_stemmer",
"lowercase",
"english_stop",
"light_english_stemmer",
"asciifolding"
]
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"message": {
"type": "text",
"analyzer": "english2",
"search_analyzer": "english2"
}
}
}
}
}
PUT twitter6/_doc/2
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "running very fast loving everything rocks pea"
}
PUT twitter1/_doc/3
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "loves risk such lips"
}
GET /twitter6/_search?q='run'
GET /twitter1/_search?q='risk'
{
"query": {
"match": {
"title": "energy"
}
}
}
#_______________________
#test mapping in small
PUT twitter/_doc/2
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "running very fast loving everything rocks pea"
}
GET /twitter/_search?q='try'
GET /twitter/_mapping/
______________________________
PUT /twitter6
{
"settings": {
"analysis": {
"filter": {
"english_stop": {
"type": "stop",
"stopwords": "_english_"
},
"light_english_stemmer": {
"type": "stemmer",
"language": "light_english"
},
"english_possessive_stemmer": {
"type": "stemmer",
"language": "possessive_english"
}
},
"analyzer": {
"english2": {
"tokenizer": "standard",
"filter": [
"english_possessive_stemmer",
"lowercase",
"english_stop",
"light_english_stemmer",
"asciifolding"
]
}
}
}
},
"mappings": {
"_doc": {
"properties": {
"message": {
"type": "text",
"analyzer": "english2",
"search_analyzer": "english2"
}
}
}
}
}
PUT twitter6/_doc/2
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "running very fast loving everything rocks pea"
}
PUT twitter1/_doc/3
{
"user" : "kimchy",
"post_date" : "2009-11-15T14:12:12",
"message" : "loves risk such lips"
}
GET /twitter6/_search?q='run'
GET /twitter1/_search?q='risk'
Comments
Post a Comment