1

I struggle to make this multi-field setting to case sensitive, what's the missing piece? Thanks in advance!!.

   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 Answer 1

2

Set the fields to 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))
))));
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks!!, so it means I don't need a multi-field setting to have a case sensitive field, I already have some "not_analyzed" fields attributes, but I run "query_string" or "term" searches with case matches, I cannot find any of them, I don't understand how come, how the query should looks like?
No problem. Yes, that is correct. Multi fields are useful for when you want to index/search the same field in different ways. For instance, if you wanted to facet on the exact value of a field, but still wanted to perform analysis to enable full-text search on that same field. The Elasticsearch getting started guide does a very good job of explaining all of this, check out the mapping and analysis section in particular.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.