Apostrophe token filter

Strips all characters after an apostrophe, including the apostrophe itself.

This filter is included in Elasticsearch’s built-in Turkish language analyzer. It uses Lucene’s ApostropheFilter, which was built for the Turkish language.

Example

The following analyze API request demonstrates how the apostrophe token filter works.

  1. GET /_analyze
  2. {
  3. "tokenizer" : "standard",
  4. "filter" : ["apostrophe"],
  5. "text" : "Istanbul'a veya Istanbul'dan"
  6. }

The filter produces the following tokens:

  1. [ Istanbul, veya, Istanbul ]

Add to an analyzer

The following create index API request uses the apostrophe token filter to configure a new custom analyzer.

  1. PUT /apostrophe_example
  2. {
  3. "settings": {
  4. "analysis": {
  5. "analyzer": {
  6. "standard_apostrophe": {
  7. "tokenizer": "standard",
  8. "filter": [ "apostrophe" ]
  9. }
  10. }
  11. }
  12. }
  13. }