IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Apostrophe token filter
editApostrophe token filter
editStrips 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
editThe following analyze API request demonstrates how the apostrophe token filter works.
response = client.indices.analyze( body: { tokenizer: 'standard', filter: [ 'apostrophe' ], text: "Istanbul'a veya Istanbul'dan" } ) puts response
GET /_analyze { "tokenizer" : "standard", "filter" : ["apostrophe"], "text" : "Istanbul'a veya Istanbul'dan" }
The filter produces the following tokens:
[ Istanbul, veya, Istanbul ]
Add to an analyzer
editThe following create index API request uses the apostrophe token filter to configure a new custom analyzer.
response = client.indices.create( index: 'apostrophe_example', body: { settings: { analysis: { analyzer: { standard_apostrophe: { tokenizer: 'standard', filter: [ 'apostrophe' ] } } } } } ) puts response
PUT /apostrophe_example { "settings": { "analysis": { "analyzer": { "standard_apostrophe": { "tokenizer": "standard", "filter": [ "apostrophe" ] } } } } }