Reasonably new to ElasticSearch / NEST - I have a property on a mapping that holds UK postcodes (eg DT5 2HW, BB1 9DR). At the moment, I have the following code:-
if (!client.IndexExists("user").Exists)
{
client.CreateIndex("user", c => c.Mappings(
m => m.Map<User>(
mp => mp.AutoMap()
)
)
);
}
I'm trying to find the correct place to specify an analyzer when creating a fluent mapping (so I can implement what's being done here), but:-
- calling
mp.AutoMap().Analyzer()
is marked as deprecated / to be removed in 6.0 with a warning that default analyzers are to be removed at the type level, and need to be specified at the index or field level (sidenote: by field, do they mean property?) Analyzer()
is not available in Intellisense after eitherKeyword()
orName()
Is it just not possible to do so via a fluent mapping? Does this mean that I have to specify the available analyzers via CreateIndex -> Settings -> Analysis, then specify the Analyzers to use on a property level with attributes on the POCO?
I feel like I've gone fundamentally wrong somewhere - any pointers would be greatly appreciated!