I am indexing in elasticsearch as I share below. But after I do the indexing process, when I search in autocomplete, it finds the text I searched for before the space, but the first key I press after the space character does not perform the search operation. When I type the 2nd or 3rd character, it returns results. How can I do the search operation with the first character I press after the space character?
The code I added my data to elasticsearch to index.
var createIndexDescriptor = new CreateIndexDescriptor(INDEX_NAME).Mappings(ms => ms.Map<GlobalCompany>(m => m.AutoMap()
.Properties(pprops => pprops
.Text(ps => ps
.Name("Title")
.Analyzer("whitespace")
.Fielddata(true)
.Fields(f => f
.Keyword(k => k
.Name("keyword")
)
)
)
)
));
The code I searched from the data I indexed in elasticsearch.
var searchResponse = eClient.Search<GlobalCompany>(s => s.Index(INDEX_NAME)
.Query(q => q
.MultiMatch(m => m
.Fields(f => f
.Field(u => u.Title)
.Field(u => u.RegisterNumber))
.Type(TextQueryType.PhrasePrefix)
.Query(value))));