@Override protected void extractUnknownQuery(Query query, Map<String, WeightedSpanTerm> terms) throws IOException { if (terms.isEmpty()) { extractWeightedTerms(terms, query, 1F); } }
protected void extract(Query query, float boost, Map<String, WeightedSpanTerm> terms) throws IOException { if (query instanceof HasChildQueryBuilder.LateParsingQuery) { // skip has_child or has_parent queries, see: https://github.com/elastic/elasticsearch/issues/14999 return; } else if (query instanceof FunctionScoreQuery) { super.extract(((FunctionScoreQuery) query).getSubQuery(), boost, terms); } else if (query instanceof FiltersFunctionScoreQuery) { super.extract(((FiltersFunctionScoreQuery) query).getSubQuery(), boost, terms); } else { super.extract(query, boost, terms); } }
@Override protected void extractUnknownQuery(Query query, Map<String, WeightedSpanTerm> terms) throws IOException { if (query instanceof FunctionScoreQuery) { query = ((FunctionScoreQuery) query).getSubQuery(); extract(query, query.getBoost(), terms); } else if (query instanceof FiltersFunctionScoreQuery) { query = ((FiltersFunctionScoreQuery) query).getSubQuery(); extract(query, query.getBoost(), terms); } else if (terms.isEmpty()) { extractWeightedTerms(terms, query, query.getBoost()); } }
@Override protected void extractUnknownQuery(Query query, Map<String, WeightedSpanTerm> terms) throws IOException { if (query instanceof CustomQuery) { extractWeightedTerms(terms, new TermQuery(((CustomQuery) query).term)); } }
public CustomQueryScorer(WeightedSpanTerm[] weightedTerms) { super(weightedTerms); }