Elasticsearch unicode search not working

Have inserted in Elasticsearch (5.0.0 version) string containing unicode characters("楫捭") by using ElasticSearch.dll versioned 5.0.0.0 and Nest.dll versioned 5.0.0.0

Using the below code for searching field with Unicode characters. Search result didnot give the any records.
How can we search fields with unicode characters. Can someone help on this please..

List enumQC = new List();
TermQuery tquery = new TermQuery() { Field = new Field("User"), Value = "楫捭" }; // this query didnot give results. (records count is zero)

IEnumerable ienumQC = new List() { tquery };
BoolQuery boolQuery = new BoolQuery(){Filter = ienumQC};
var searchResult = client.Search(x => x
.Index("mynewindex5")
.Type("mynewindex5")
.Query(p => +boolQuery)
.Size(1000)
.Preference("Default")
.Scroll("60s"));

You might have to index the field using language analyzer https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html

multi-field analyzer will work in your case https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html#_multi_fields_with_multiple_analyzers

1 Like

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