mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-02 17:09:18 +00:00
add SearchContext to innerParse method
This commit is contained in:
parent
6295738d4c
commit
d113b59e86
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user