You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all SearchParseElement classes are implemented like this:
public class HighlighterParseElement implements SearchParseElement { @OverRide
public void parse(XContentParser parser, SearchContext context) throws Exception {
// actual parsing logic
context.highlight(new SearchContextHighlight(fields));
}
}
For some (advanced) uses I want to be able to parse individual elements myself by relying on the actual core implementation, and to do that I need to use a hack like this:
Just for the sake of parsing. It would be nice if the actual parsing logic could be separated from the call to the setter, something like this:
@Override
public void parse(XContentParser parser, SearchContext context) throws Exception {
try {
context.highlight(parseImpl(parser));
}
catch (IllegalArgumentException ex)
{
throw new SearchParseException(context, "Highlighter global preTags are set, but global postTags are not set");
}
}
public static SearchContextHighlight parseImpl(XContentParser parser) throws Exception {
// actual impl
}
The text was updated successfully, but these errors were encountered:
I added one commit changing only HighlighterParseElement for now, please review and if my approach makes sense (the re-throwing logic etc) I'll go ahead and apply this all over the place
Currently all SearchParseElement classes are implemented like this:
public class HighlighterParseElement implements SearchParseElement {
@OverRide
public void parse(XContentParser parser, SearchContext context) throws Exception {
// actual parsing logic
context.highlight(new SearchContextHighlight(fields));
}
}
For some (advanced) uses I want to be able to parse individual elements myself by relying on the actual core implementation, and to do that I need to use a hack like this:
Just for the sake of parsing. It would be nice if the actual parsing logic could be separated from the call to the setter, something like this:
}
The text was updated successfully, but these errors were encountered: