More_like_this search doesn't work


(Artem) #1

Hi, there. Trying to use more_like_this function and seems like it doesn't work at the latest version of ES. Any ideas what is wrong?

-----I have created index ----

PUT /test_index2
{

"mappings": {
"doc": {
"properties": {
"city": {
"type": "text",
"term_vector": "yes",
"analyzer": "keyword"
}
}
}
}
}

PUT /test_index2/doc/2
{
"city": ["Wellington"]
}

---- put some data ----
PUT /test_index2/doc/2
{
"city": ["New York"]
}

--- now trying to search ---
GET test_index2/_search
{
"query": {
"more_like_this" : {
"fields" : ["city"],
"like" : "Welling"
}
}
}


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.