File tree 1 file changed +6
-3
lines changed
docs/reference/analysis/tokenfilters
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 4
4
<titleabbrev>Trim</titleabbrev>
5
5
++++
6
6
7
- Removes leading and trailing whitespace from each token in a stream.
7
+ Removes leading and trailing whitespace from each token in a stream. While this
8
+ can change the length of a token, the `trim` filter does _not_ change a token's
9
+ offsets.
8
10
9
11
The `trim` filter uses Lucene's
10
12
https://lucene.apache.org/core/{lucene_version_path}/analyzers-common/org/apache/lucene/analysis/miscellaneous/TrimFilter.html[TrimFilter].
@@ -37,8 +39,9 @@ GET _analyze
37
39
}
38
40
----
39
41
40
- The API returns the following response. Note the `" fox "` token contains
41
- the original text's whitespace.
42
+ The API returns the following response. Note the `" fox "` token contains the
43
+ original text's whitespace. Note that despite changing the token's length, the
44
+ `start_offset` and `end_offset` remain the same.
42
45
43
46
[source,console-result]
44
47
----
You can’t perform that action at this time.
0 commit comments