Hi, How can i add analyzers to my index without removing the SynonymAnalyzer?
We need to have the lower_case analyzer active in one of our index’s but when we add that it removes the SynonymAnalizer and that brakes our search. We use:
public class ProductIndexConfiguration : MultilingualIndexConfigurationBase<ProductDocument>
{
protected override CreateIndexDescriptor BuildIndexDescriptor(CultureInfo cultureInfo, CreateIndexDescriptor descriptor)
{
return base.BuildIndexDescriptor(cultureInfo, descriptor)
// add the custom normalizer that will be used together with the keyword analyzer.
.Settings(s => s.Analysis(a => a.Normalizers(n => n.Custom("my_normalizer", cn => cn.Filters("lowercase")))));
}
To add it, what do we need to include to keep the analyzer configured by litium?
The thinking was that you should be able to do exactly what you was doing without that you should lose the synonym analyzer. Somehow the third-party component that is used for Elasticsearch connection are replacing any existing configuration when the Settings are built.
Oki, one more thing am struggeling with in the product document we have:
[Nested]
public List<TagItem> Tags { get; set; } = new List<TagItem>();
This will automaticly create a nested type, but this dose not work if i use setters:
this dose not works:
public class TagItem
{
private string _value;
private string _key;
[Keyword]
public string Key
{
get => _key;
set => _key = value.ToLower();
}
[Keyword(EagerGlobalOrdinals = true)]
public string Value
{
get => _value;
set => _value = value.ToLower();
}
}
But this works:
public class TagItem
{
[Keyword]
public string Key { get; set ;}
[Keyword(EagerGlobalOrdinals = true)]
public string Value { get; set ;}
}
Do you do custom mapping? Do i do this wrong or is this a nest bug?
When the tag index mapping is created it will not be a nested object, if i use a setter in the class.