Skip to content

Expose fragmenter option for plain highlighter #2465

@martijnvg

Description

@martijnvg

The plain highlighter exposes the ability how text should be broken up in highlight snippets. There are two possible options:

  • simple - Breaks up text into same sized fragments.
  • span - Same as the simple fragmenter, but tries not to break up text between highlighted terms (this is applicable when using phrase like queries). This is the default.

Example

curl -XGET 'localhost:9200/_search' -d '{
   "query" : {
       "match" : {
           "body" : {
               "some text"
           }
       }
    },
    "highlight":{
       "fields":{
         "body":{
            "fragment_size":200,
            "fragmenter" : "simple"
         }
      }
   }
}'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions