@@ -397,6 +397,34 @@ public void ngramAnalyzer() {
397
397
createGetAndDeleteAnalyzer (options );
398
398
}
399
399
400
+ @ Test
401
+ public void enhancedNgramAnalyzer () {
402
+ assumeTrue (isAtLeastVersion (3 , 6 ));
403
+
404
+ String name = "test-" + UUID .randomUUID ().toString ();
405
+
406
+ Set <AnalyzerFeature > features = new HashSet <>();
407
+ features .add (AnalyzerFeature .frequency );
408
+ features .add (AnalyzerFeature .norm );
409
+ features .add (AnalyzerFeature .position );
410
+
411
+ Map <String , Object > properties = new HashMap <>();
412
+ properties .put ("max" , 6L );
413
+ properties .put ("min" , 3L );
414
+ properties .put ("preserveOriginal" , true );
415
+ properties .put ("startMarker" , "^" );
416
+ properties .put ("endMarker" , "^" );
417
+ properties .put ("streamType" , "utf8" );
418
+
419
+ AnalyzerEntity options = new AnalyzerEntity ();
420
+ options .setFeatures (features );
421
+ options .setName (name );
422
+ options .setType (AnalyzerType .ngram );
423
+ options .setProperties (properties );
424
+
425
+ createGetAndDeleteAnalyzer (options );
426
+ }
427
+
400
428
@ Test
401
429
public void textAnalyzer () {
402
430
assumeTrue (isAtLeastVersion (3 , 5 ));
@@ -424,6 +452,39 @@ public void textAnalyzer() {
424
452
createGetAndDeleteAnalyzer (options );
425
453
}
426
454
455
+ @ Test
456
+ public void enhancedTextAnalyzer () {
457
+ assumeTrue (isAtLeastVersion (3 , 6 ));
458
+
459
+ String name = "test-" + UUID .randomUUID ().toString ();
460
+
461
+ Set <AnalyzerFeature > features = new HashSet <>();
462
+ features .add (AnalyzerFeature .frequency );
463
+ features .add (AnalyzerFeature .norm );
464
+ features .add (AnalyzerFeature .position );
465
+
466
+ Map <String , Object > edgeNgram = new HashMap <>();
467
+ edgeNgram .put ("min" , 2L );
468
+ edgeNgram .put ("max" , 100000L );
469
+ edgeNgram .put ("preserveOriginal" , true );
470
+
471
+ Map <String , Object > properties = new HashMap <>();
472
+ properties .put ("locale" , "ru.utf-8" );
473
+ properties .put ("case" , "lower" );
474
+ properties .put ("stopwords" , Collections .emptyList ());
475
+ properties .put ("accent" , true );
476
+ properties .put ("stemming" , true );
477
+ properties .put ("edgeNgram" , edgeNgram );
478
+
479
+ AnalyzerEntity options = new AnalyzerEntity ();
480
+ options .setFeatures (features );
481
+ options .setName (name );
482
+ options .setType (AnalyzerType .text );
483
+ options .setProperties (properties );
484
+
485
+ createGetAndDeleteAnalyzer (options );
486
+ }
487
+
427
488
@ Test
428
489
public void arangoSearchOptions () {
429
490
assumeTrue (isAtLeastVersion (3 , 4 ));
0 commit comments