@Override protected Query getFieldQuery(final String field, final String queryText, final boolean quoted) throws ParseException { final TypedField typedField = new TypedField(field); if (typedField.getType() == FieldType.TEXT) { return super.getFieldQuery(field, queryText, quoted); } return typedField.toTermQuery(queryText); }
@Override protected Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { Query q = super.getFieldQuery(fields[i], queryText, quoted); if (q != null) { //If the user passes a map of boosts if (boosts != null) { //Get the boost from the map and apply them Float boost = boosts.get(fields[i]); if (boost != null) { q = new BoostQuery(q, boost.floatValue()); } } clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD)); } } if (clauses.size() == 0) // happens for stopwords return null; return getBooleanQuery(clauses, true); } Query q = super.getFieldQuery(field, queryText, quoted); return q; }
@Override protected Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { Query q = super.getFieldQuery(fields[i], queryText, quoted); if (q != null) { //If the user passes a map of boosts if (boosts != null) { //Get the boost from the map and apply them Float boost = boosts.get(fields[i]); if (boost != null) { q = new BoostQuery(q, boost.floatValue()); } } clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD)); } } if (clauses.size() == 0) // happens for stopwords return null; return getBooleanQuery(clauses, true); } Query q = super.getFieldQuery(field, queryText, quoted); return q; }
@Override protected Query getFieldQuery(String field, String queryText, int slop) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { Query q = super.getFieldQuery(fields[i], queryText, true); if (q != null) { //If the user passes a map of boosts if (boosts != null) { //Get the boost from the map and apply them Float boost = boosts.get(fields[i]); if (boost != null) { q = new BoostQuery(q, boost.floatValue()); } } q = applySlop(q,slop); clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD)); } } if (clauses.size() == 0) // happens for stopwords return null; return getBooleanQuery(clauses, true); } Query q = super.getFieldQuery(field, queryText, true); q = applySlop(q,slop); return q; }
@Override protected Query getFieldQuery(String field, String queryText, int slop) throws ParseException { if (field == null) { List<BooleanClause> clauses = new ArrayList<>(); for (int i = 0; i < fields.length; i++) { Query q = super.getFieldQuery(fields[i], queryText, true); if (q != null) { //If the user passes a map of boosts if (boosts != null) { //Get the boost from the map and apply them Float boost = boosts.get(fields[i]); if (boost != null) { q = new BoostQuery(q, boost.floatValue()); } } q = applySlop(q,slop); clauses.add(new BooleanClause(q, BooleanClause.Occur.SHOULD)); } } if (clauses.size() == 0) // happens for stopwords return null; return getBooleanQuery(clauses, true); } Query q = super.getFieldQuery(field, queryText, true); q = applySlop(q,slop); return q; }
@Override protected Query getFieldQuery(final String field, final String queryText, boolean quoted) throws ParseException { final Pair<String,String> splitExtensionField = this.extensions .splitExtensionField(defaultField, field); final ParserExtension extension = this.extensions .getExtension(splitExtensionField.cud); if (extension != null) { return extension.parse(new ExtensionQuery(this, splitExtensionField.cur, queryText)); } return super.getFieldQuery(field, queryText, quoted); }
@Override protected Query getFieldQuery(final String field, final String queryText, boolean quoted) throws ParseException { final Pair<String,String> splitExtensionField = this.extensions .splitExtensionField(defaultField, field); final ParserExtension extension = this.extensions .getExtension(splitExtensionField.cud); if (extension != null) { return extension.parse(new ExtensionQuery(this, splitExtensionField.cur, queryText)); } return super.getFieldQuery(field, queryText, quoted); }
boolean added = false; for (String mField : fields) { Query q = super.getFieldQuery(mField, queryText, slop); if (q != null) { added = true; List<BooleanClause> clauses = new ArrayList<>(); for (String mField : fields) { Query q = super.getFieldQuery(mField, queryText, slop); if (q != null) { applyBoost(mField, q); return super.getFieldQuery(field, queryText, slop);
query = super.getFieldQuery(currentFieldType.names().indexName(), queryText, quoted); return super.getFieldQuery(field, queryText, quoted); } finally { setAnalyzer(oldAnalyzer);