Skip to content

Commit 8cf4eb3

Browse files
authored
Test that no-index synonyms can be used with the Analyze API (#40781)
Relates to #23943
1 parent f3650b4 commit 8cf4eb3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/40_token_filters.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,34 @@
273273
- match: { tokens.3.token: magazine }
274274
- match: { tokens.3.position: 2 }
275275

276+
---
277+
"synonym_without_index":
278+
- do:
279+
indices.analyze:
280+
body:
281+
text: wibble
282+
tokenizer: standard
283+
filter: [ { type: synonym, synonyms: [ "wibble, quack" ]}]
284+
- length: { tokens: 2 }
285+
- match: { tokens.0.token: wibble }
286+
- match: { tokens.0.position: 0 }
287+
- match: { tokens.1.token: quack }
288+
- match: { tokens.1.position: 0 }
289+
290+
---
291+
"synonym_graph_without_index":
292+
- do:
293+
indices.analyze:
294+
body:
295+
text: wibble
296+
tokenizer: standard
297+
filter: [ { type: synonym_graph, synonyms: [ "wibble, quack" ]}]
298+
- length: { tokens: 2 }
299+
- match: { tokens.0.token: quack }
300+
- match: { tokens.0.position: 0 }
301+
- match: { tokens.1.token: wibble }
302+
- match: { tokens.1.position: 0 }
303+
276304
---
277305
"synonym_graph":
278306
- do:

0 commit comments

Comments
 (0)