Elasticsearch NEST,区分大小写的多字段

时间:2014-06-02 16:32:32

标签: case nest

我很难将这个多字段设置设置为区分大小写,缺少的是什么? 在此先感谢!!。

   targetClientProperties.MapFluent< CMSDocument >
    ( m => m. MapFromAttributes() 
           .Properties( p => p.MultiField( mf => mf
                                    .Name ( n => n.Hash )
                                    .Fields(fs => fs
                                            .String(s => s.Name(t => t.PropertyHash))
                                            .String(s => s.Name(t => t.TileHash))
    ))));

1 个答案:

答案 0 :(得分:2)

将字段设置为not_analyzed

targetClientProperties.MapFluent< CMSDocument >
( m => m. MapFromAttributes() 
       .Properties( p => p.MultiField( mf => mf
                                .Name ( n => n.Hash )
                                .Fields(fs => fs
                                        .String(s => s.Name(t => t.PropertyHash).Index(FieldIndexOption.not_analyzed))
                                        .String(s => s.Name(t => t.TileHash).Index(FieldIndexOption.not_analyzed))
))));