use of org.opensearch.index.mapper.TextSearchInfo in project OpenSearch by opensearch-project.
the class AbstractSuggestionBuilderTestCase method mockFieldType.
protected MappedFieldType mockFieldType(String fieldName, boolean analyzerSet) {
MappedFieldType fieldType = mock(MappedFieldType.class);
when(fieldType.name()).thenReturn(fieldName);
NamedAnalyzer searchAnalyzer = analyzerSet ? new NamedAnalyzer("fieldSearchAnalyzer", AnalyzerScope.INDEX, new SimpleAnalyzer()) : null;
TextSearchInfo tsi = new TextSearchInfo(TextFieldMapper.Defaults.FIELD_TYPE, null, searchAnalyzer, searchAnalyzer);
when(fieldType.getTextSearchInfo()).thenReturn(tsi);
return fieldType;
}
Aggregations