Elastic Search Hyphen issue with term filter

后端 未结 3 1076
忘了有多久
忘了有多久 2020-12-12 20:45

I have the following Elastic Search query with only a term filter. My query is much more complex but I am just trying to show the issue here.

{
    \"filter\         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-12 21:02

    Based on the answer by @imotov If you're using spring-data-elasticsearch then all you need to do is mark your field as:

    @Field(type = FieldType.String, index = FieldIndex.not_analyzed)
    

    instead of

    @Field(type = FieldType.String)
    

    The problem is you need to drop the index though and re-instantiate it with new mappings.

提交回复
热议问题