Elasticsearch Escape WhiteSpace Character


(Emre K) #1

I have two records in my index.
This records;

> var person = new Person
>     {
>         Id = "1",
>         Firstname = "john smith",
>         Lastname = "hendrick"
>     };
>     var person2 = new Person
>     {
>         Id = "2",
>         Firstname = "smith john",
>         Lastname = "hendrick"
>     };

In kibana, I am writing this query joh\ smith*. And i want to result only "John Smith".But result is empty.Also i try with quotes querystring "joh smith"* still result is empty.What can i do this querystring ?


(Mark Walkom) #2

Because the default behaviour is for the analyser to break tokens (words) up by whitespaces.

You will want to set that field to non-analysed in the mappings if you want to be able to query it exactly as it is indexed.


(system) #3