Disable Date detection for fields / index using nest


(Dror Shahak) #1

Hi,
I'm indexing strings and am getting the date strings detected and re-formatted against my will.
How would i efine it against the NEST client?

below is the way I map the fields to my > NestedObjectMappingDescriptor

        selector.Properties(props1 => props1
                .String(smd => smd.Name(par => par.Id).Index(FieldIndexOption.NotAnalyzed))
                .String(smd => smd.Name(par => par.Text).Index(FieldIndexOption.Analyzed).IndexAnalyzer(ElasticSearchWrapper.StandardAnalyzer))
                .String(smd => smd.Name(par => par.ContentType).Index(FieldIndexOption.NotAnalyzed)));

If this is not possible, I might be inclined to define this for the entire index, How would I do that in NEST?

here is my index creation:

CreateIndexDescriptor result = indexDescriptor

                              .Analysis(c => c
                                  .Tokenizers((a) => new FluentDictionary<string, TokenizerBase> { { tokenizerName, nGramTokenizer } })
                                 .Analyzers(d => d.Add(NGramAnalyzer, customAnalyzer)
                                                  .Add(StandardAnalyzer, new StandardAnalyzer())
                                                  .Add(CaseInsensitiveSortAnalyzer, caseInsensitiveSortAnalyzer)))

And lastly, can I define this in a config file (yml) for elastic?

Thanks in Advance,
Dror


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.