File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
test/framework/src/main/java/org/elasticsearch/index/mapper Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,8 @@ public final void testIsParsedFromSource() throws IOException {
443443 MapperService mapperService = createMapperService (mapping );
444444 SearchExecutionContext c = createSearchExecutionContext (mapperService );
445445 {
446+ // The field_source uses parseFromSource(...) in compileScript(...) method in this class.
447+ // This triggers calling SearchLookup#optimizedSourceProvider(...) which should return more optimized source.
446448 var fieldType = (AbstractScriptFieldType ) c .getFieldType ("field_source" );
447449 SearchLookup searchLookup = mock (SearchLookup .class );
448450 when (searchLookup .optimizedSourceProvider (any ())).thenReturn (searchLookup );
@@ -451,6 +453,7 @@ public final void testIsParsedFromSource() throws IOException {
451453 verify (searchLookup , times (1 )).optimizedSourceProvider (any ());
452454 }
453455 {
456+ // The field uses normal scripts and that should never cause SearchLookup#optimizedSourceProvider(...) to be invoked:
454457 var fieldType = (AbstractScriptFieldType ) c .getFieldType ("field" );
455458 SearchLookup searchLookup = mock (SearchLookup .class );
456459 when (searchLookup .optimizedSourceProvider (any ())).thenReturn (searchLookup );
You can’t perform that action at this time.
0 commit comments