Skip to content

Commit

Permalink
CI fix - remove unsafe assertion in wildcard field (#78966) (#78974)
Browse files Browse the repository at this point in the history
Remove unsafe assertion now that wildcard field does not simplify BooleanQuery logic - can’t rely on it rewriting to a plain MatchAllDocsQuery and is sometimes wrapped in other layers
Closes #78949
  • Loading branch information
markharwood authored Oct 12, 2021
1 parent e7d87dc commit 3dda4bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.apache.lucene.search.ConstantScoreWeight;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreMode;
import org.apache.lucene.search.Scorer;
Expand Down Expand Up @@ -84,8 +83,7 @@ public Scorer scorer(LeafReaderContext context) throws IOException {
public boolean matches() throws IOException {
if (values.advanceExact(approxDisi.docID()) == false)
{
// Bug if we have an indexed value (i.e an approxQuery) but no doc value.
assert approxQuery instanceof MatchAllDocsQuery;
// Can happen when approxQuery resolves to some form of MatchAllDocs expression
return false;
}
BytesRef arrayOfValues = values.binaryValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ private void expectPrefixMatch(IndexSearcher searcher, String term,long count) t
assertThat(td.totalHits.value, equalTo(count));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/78949")
public void testSearchResultsVersusKeywordField() throws IOException {
Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig(WildcardFieldMapper.WILDCARD_ANALYZER_7_10);
Expand Down

0 comments on commit 3dda4bd

Please sign in to comment.