@@ -493,19 +493,20 @@ void enhancedTextAnalyzerTyped(ArangoDatabase db) {
493
493
void arangoSearchOptions (ArangoDatabase db ) {
494
494
assumeTrue (isAtLeastVersion (3 , 4 ));
495
495
String viewName = "view-" + rnd ();
496
- ArangoSearchCreateOptions options = new ArangoSearchCreateOptions ()
497
- .link (
498
- CollectionLink .on (COLL_1 )
499
- .analyzers ("identity" )
500
- .fields (
501
- FieldLink .on ("id" )
502
- .analyzers ("identity" )
503
- )
504
- .includeAllFields (true )
505
- .storeValues (StoreValuesType .ID )
506
- .trackListPositions (false )
507
-
508
- );
496
+ FieldLink field = FieldLink .on ("f1" );
497
+ if (isEnterprise ()) {
498
+ field .nested (FieldLink .on ("f2" ));
499
+ }
500
+ CollectionLink link = CollectionLink .on (COLL_1 )
501
+ .analyzers ("identity" )
502
+ .fields (field )
503
+ .includeAllFields (true )
504
+ .storeValues (StoreValuesType .ID )
505
+ .trackListPositions (false );
506
+ if (isEnterprise ()) {
507
+ link .nested (FieldLink .on ("f3" ));
508
+ }
509
+ ArangoSearchCreateOptions options = new ArangoSearchCreateOptions ().link (link );
509
510
510
511
final ArangoSearch view = db .arangoSearch (viewName );
511
512
view .create (options );
@@ -515,13 +516,27 @@ void arangoSearchOptions(ArangoDatabase db) {
515
516
assertThat (properties .getId ()).isNotNull ();
516
517
assertThat (properties .getName ()).isEqualTo (viewName );
517
518
assertThat (properties .getType ()).isEqualTo (ViewType .ARANGO_SEARCH );
519
+ assertThat (properties .getLinks ()).isNotEmpty ();
520
+
521
+ CollectionLink createdLink = properties .getLinks ().iterator ().next ();
522
+ assertThat (createdLink .getName ()).isEqualTo (COLL_1 );
523
+ assertThat (createdLink .getAnalyzers ()).contains ("identity" );
524
+ assertThat (createdLink .getIncludeAllFields ()).isTrue ();
525
+ assertThat (createdLink .getStoreValues ()).isEqualTo (StoreValuesType .ID );
526
+ assertThat (createdLink .getTrackListPositions ()).isFalse ();
527
+ if (isEnterprise () && isAtLeastVersion (3 , 10 )) {
528
+ assertThat (createdLink .getNested ()).isNotEmpty ();
529
+ FieldLink nested = createdLink .getNested ().iterator ().next ();
530
+ assertThat (nested .getName ()).isEqualTo ("f3" );
531
+ }
518
532
519
- CollectionLink link = properties .getLinks ().iterator ().next ();
520
- assertThat (link .getAnalyzers ()).contains ("identity" );
521
- assertThat (link .getName ()).isEqualTo (COLL_1 );
522
- assertThat (link .getIncludeAllFields ()).isTrue ();
523
- assertThat (link .getStoreValues ()).isEqualTo (StoreValuesType .ID );
524
- assertThat (link .getTrackListPositions ()).isFalse ();
533
+ FieldLink fieldLink = createdLink .getFields ().iterator ().next ();
534
+ assertThat (fieldLink .getName ()).isEqualTo ("f1" );
535
+ if (isEnterprise () && isAtLeastVersion (3 , 10 )) {
536
+ assertThat (fieldLink .getNested ()).isNotEmpty ();
537
+ FieldLink nested = fieldLink .getNested ().iterator ().next ();
538
+ assertThat (nested .getName ()).isEqualTo ("f2" );
539
+ }
525
540
}
526
541
527
542
@ ParameterizedTest (name = "{index}" )
0 commit comments