@Test
public void testCrossFieldMatchType() throws Exception {
Analyzer analyzer = new GermanAnalyzer(Version.LUCENE_4_9);
SearchContext searchContext = mock(SearchContext.class);
MapperService.SmartNameFieldMappers smartNameFieldMappers = mock(MapperService.SmartNameFieldMappers.class);
when(searchContext.smartFieldMappers(anyString())).thenReturn(smartNameFieldMappers);
when(smartNameFieldMappers.hasMapper()).thenReturn(true);
FieldMapper fieldMapper = mock(FieldMapper.class, Answers.RETURNS_MOCKS.get());
when(smartNameFieldMappers.mapper()).thenReturn(fieldMapper);
when(fieldMapper.searchAnalyzer()).thenReturn(analyzer);