GET _search
{
"query": {
"query_string": {
"query": "curator"
}
}
}
==> returned 3 items
GET _search
{
"query": {
"query_string": {
"query": "curato"
}
}
}
==> returned 0 item
GET _search
{
"query": {
"query_string": {
"query": "curat"
}
}
}
==> returned 3 items
I don't know what are differences between 3 keywords "curator", "curato" and "curat" ==> should return 3 items as expected. Any suggestions or explanations for these cases?
With your query you are looking for the exact terms "curator", "curato" or "curat". Whether you have those terms in your index or not depends on your data and how you indexed it (analysis chain).
Are you rather looking for anything that starts with "curat" ?
I limited the query with only field
"fields": [
"PostText"
],
and data source only have 3 documents
"PostText": "curator post",
"PostText": "abc 4 curator post",
"PostText": "curator post 2",
even I used wildcard for search string but the result is not good
GET _search
{
"query": {
"query_string": {
"fields": [
"PostText"
],
"query": "STARcuratoSTAR", ==> STAR: *
"analyze_wildcard": true
}
}
}
==> returned 0 item
I set analyzer like that:
var indexSettings={
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "smartcn"
}
}
}
}
};
Ok, I think that means you want to do partial search, and using wildcards is one away, but there are others way too. First of all though, could you explain what your usecase is, just to verify that you indeed need partial search?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.