Skip to content

Commit

Permalink
Revert "test: don't do fuzzy on bool field"
Browse files Browse the repository at this point in the history
This reverts commit 78d2311.
martijnvg committed Apr 6, 2016
1 parent 5ff68d1 commit ec4ebf3
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
@@ -851,8 +851,6 @@ protected static Fuzziness randomFuzziness(String fieldName) {
return Fuzziness.build(1 + randomFloat() * 10);
case DATE_FIELD_NAME:
return Fuzziness.build(randomTimeValue());
case BOOLEAN_FIELD_NAME:
return null;
default:
if (randomBoolean()) {
return Fuzziness.fromEdits(randomIntBetween(0, 2));
Original file line number Diff line number Diff line change
@@ -19,8 +19,6 @@

package org.elasticsearch.index.query;

import org.apache.lucene.analysis.core.SimpleAnalyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.queries.ExtendedCommonTermsQuery;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
@@ -36,7 +34,6 @@
import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.index.mapper.MappedFieldType;
import org.elasticsearch.index.mapper.core.BooleanFieldMapper;
import org.elasticsearch.index.search.MatchQuery;
import org.elasticsearch.index.search.MatchQuery.Type;
import org.elasticsearch.index.search.MatchQuery.ZeroTermsQuery;
@@ -80,10 +77,7 @@ protected MatchQueryBuilder doCreateTestQueryBuilder() {
}

if (randomBoolean()) {
Fuzziness fuzziness = randomFuzziness(fieldName);
if (fuzziness != null) {
matchQuery.fuzziness();
}
matchQuery.fuzziness(randomFuzziness(fieldName));
}

if (randomBoolean()) {

0 comments on commit ec4ebf3

Please sign in to comment.