@Override protected Query getPrefixQuery(String field, String term) throws ParseException { return super.getPrefixQuery(field, getCanonicalTerm(field, term)); }
/** * Called when parser parses an input term * that uses prefix notation; that is, contains a single '*' wildcard * character as its last character. Since this is a special case * of generic wildcard term, and such a query can be optimized easily, * this usually results in a different query object. * <p> * Depending on analyzer and settings, a prefix term may (most probably will) * be lower-cased automatically. It <b>will</b> go through the default Analyzer. * <p> * Overrides super class, by passing terms through analyzer. * * @param field Name of the field query will use. * @param termStr Term to use for building term for the query * (<b>without</b> trailing '*' character!) * * @return Resulting {@link Query} built for the term */ @Override protected Query getPrefixQuery(String field, String termStr) throws ParseException { String analyzed = analyzeSingleChunk(field, termStr, termStr); return super.getPrefixQuery(field, analyzed); }
/** * Called when parser parses an input term * that uses prefix notation; that is, contains a single '*' wildcard * character as its last character. Since this is a special case * of generic wildcard term, and such a query can be optimized easily, * this usually results in a different query object. * <p> * Depending on analyzer and settings, a prefix term may (most probably will) * be lower-cased automatically. It <b>will</b> go through the default Analyzer. * <p> * Overrides super class, by passing terms through analyzer. * * @param field Name of the field query will use. * @param termStr Term to use for building term for the query * (<b>without</b> trailing '*' character!) * * @return Resulting {@link Query} built for the term */ @Override protected Query getPrefixQuery(String field, String termStr) throws ParseException { String analyzed = analyzeSingleChunk(field, termStr, termStr); return super.getPrefixQuery(field, analyzed); }
@Override protected Query getPrefixQuery(String field, String termStr) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { clauses.add(new BooleanClause(getPrefixQuery(fields[i], termStr), BooleanClause.Occur.SHOULD)); } return getBooleanQuery(clauses, true); } return super.getPrefixQuery(field, termStr); }
@Override protected Query getPrefixQuery(String field, String termStr) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { clauses.add(new BooleanClause(getPrefixQuery(fields[i], termStr), BooleanClause.Occur.SHOULD)); } return getBooleanQuery(clauses, true); } return super.getPrefixQuery(field, termStr); }
private Query getPossiblyAnalyzedPrefixQuery(String field, String termStr) throws ParseException { if (!analyzeWildcard) { return super.getPrefixQuery(field, termStr); source.reset(); } catch (IOException e) { return super.getPrefixQuery(field, termStr); return super.getPrefixQuery(field, tlist.get(0).get(0)); if (plist.size() == 1) { if (isLastPos) { posQuery = super.getPrefixQuery(field, plist.get(0)); } else { posQuery = newTermQuery(new Term(field, plist.get(0)));