Skip to content

Commit

Permalink
HSEARCH-3992 Test more use cases of @FullTextField.analyzer/searchAna…
Browse files Browse the repository at this point in the history
…lyzer
  • Loading branch information
yrodiere authored and fax4ever committed Sep 22, 2020
1 parent 1737831 commit 6c31915
Showing 1 changed file with 38 additions and 0 deletions.
Expand Up @@ -218,6 +218,24 @@ class IndexedEntity {
backendMock.verifyExpectationsMet();
}

@Test
public void analyzer() {
final String analyzerName = "analyzerName";
@Indexed(index = INDEX_NAME)
class IndexedEntity {
@DocumentId
Integer id;
@FullTextField(analyzer = analyzerName)
String text;
}

backendMock.expectSchema( INDEX_NAME, b -> b
.field( "text", String.class, f -> f.analyzerName( analyzerName ) )
);
setupHelper.start().setup( IndexedEntity.class );
backendMock.verifyExpectationsMet();
}

@Test
public void searchAnalyzer() {
final String searchAnalyzerName = "searchAnalyzerName";
Expand All @@ -237,6 +255,26 @@ class IndexedEntity {
backendMock.verifyExpectationsMet();
}

@Test
public void analyzer_searchAnalyzer() {
final String analyzerName = "analyzerName";
final String searchAnalyzerName = "searchAnalyzerName";
@Indexed(index = INDEX_NAME)
class IndexedEntity {
@DocumentId
Integer id;
@FullTextField(analyzer = analyzerName, searchAnalyzer = searchAnalyzerName)
String text;
}

backendMock.expectSchema( INDEX_NAME, b -> b
.field( "text", String.class, f -> f.analyzerName( analyzerName )
.searchAnalyzerName( searchAnalyzerName ) )
);
setupHelper.start().setup( IndexedEntity.class );
backendMock.verifyExpectationsMet();
}

@Test
public void customBridge_implicitFieldType() {
@Indexed(index = INDEX_NAME)
Expand Down

0 comments on commit 6c31915

Please sign in to comment.