Hi,
For multi fields creation in NEST, I am using below approach (ElasticSearchProperties - is a class file having City, Email as strings) :-
.Mappings(ms => ms.Map(m1 => m1
.AutoMap()
.AllField(af => af.Enabled(false))
.Properties(p => p
.Text(t => t
.Name(n => n.City)
.Index(false)
.CopyTo(c => c.Field("Address"))
)
.Text(t => t
.Name(n => n.Email)
.Fields(f => f
.Text(tt => tt
.Name("Prefix")
.Analyzer(BasicPrefixAnalyzer)
.SearchAnalyzer(BasicAnalyzer)
)
)
.Analyzer(BasicAnalyzer)
)
)
)
)
- Is there a way by which I can create multifields (or sub fields, for example "Prefix" field above) using POCO?
- Is there a way of creating a Generic method, to which I will pass attribute and it will create me properties for a document. Not necessary the above structure, it may be anything (like Sub field as Keyword etc etc)?