add SearchContext to innerParse method

This commit is contained in:
Britta Weber 2015-07-29 16:06:40 +02:00
parent 6295738d4c
commit d113b59e86
3 changed files with 4 additions and 4 deletions

View File

@ -33,13 +33,13 @@ public abstract class FetchSubPhaseParseElement<SubPhaseContext extends FetchSub
SubPhaseContext fetchSubPhaseContext = context.getFetchSubPhaseContext(getContextFactory());
// this is to make sure that the SubFetchPhase knows it should execute
fetchSubPhaseContext.setHitExecutionNeeded(true);
innerParse(parser, fetchSubPhaseContext);
innerParse(parser, fetchSubPhaseContext, context);
}
/**
* Implement the actual parsing here.
*/
protected abstract void innerParse(XContentParser parser, SubPhaseContext fetchSubPhaseContext) throws Exception;
protected abstract void innerParse(XContentParser parser, SubPhaseContext fetchSubPhaseContext, SearchContext searchContext) throws Exception;
/**
* Return the ContextFactory for this FetchSubPhase.

View File

@ -39,7 +39,7 @@ import org.elasticsearch.search.internal.SearchContext;
public class FieldDataFieldsParseElement extends FetchSubPhaseParseElement<FieldDataFieldsContext> {
@Override
protected void innerParse(XContentParser parser, FieldDataFieldsContext fieldDataFieldsContext) throws Exception {
protected void innerParse(XContentParser parser, FieldDataFieldsContext fieldDataFieldsContext, SearchContext searchContext) throws Exception {
XContentParser.Token token = parser.currentToken();
if (token == XContentParser.Token.START_ARRAY) {
while (parser.nextToken() != XContentParser.Token.END_ARRAY) {

View File

@ -186,7 +186,7 @@ public class FetchSubPhasePluginTests extends ElasticsearchIntegrationTest {
public static class TermVectorsFetchParseElement extends FetchSubPhaseParseElement<TermVectorsFetchContext> {
@Override
protected void innerParse(XContentParser parser, TermVectorsFetchContext termVectorsFetchContext) throws Exception {
protected void innerParse(XContentParser parser, TermVectorsFetchContext termVectorsFetchContext, SearchContext searchContext) throws Exception {
XContentParser.Token token = parser.currentToken();
if (token == XContentParser.Token.VALUE_STRING) {
String fieldName = parser.text();