parent
148dc3c013
commit
c8285739d2
|
@ -562,7 +562,7 @@ public class MapperQueryParser extends QueryParser {
|
||||||
if (actualField == null) {
|
if (actualField == null) {
|
||||||
return newMatchAllDocsQuery();
|
return newMatchAllDocsQuery();
|
||||||
}
|
}
|
||||||
if ("_all".equals(actualField)) {
|
if ("*".equals(actualField) || "_all".equals(actualField)) {
|
||||||
return newMatchAllDocsQuery();
|
return newMatchAllDocsQuery();
|
||||||
}
|
}
|
||||||
// effectively, we check if a field exists or not
|
// effectively, we check if a field exists or not
|
||||||
|
|
|
@ -257,6 +257,17 @@ public class SimpleIndexQueryParserTests {
|
||||||
assertThat((double) matchAllDocsQuery.getBoost(), closeTo(1.2, 0.01));
|
assertThat((double) matchAllDocsQuery.getBoost(), closeTo(1.2, 0.01));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStarColonStar() throws Exception {
|
||||||
|
IndexQueryParserService queryParser = queryParser();
|
||||||
|
String query = copyToStringFromClasspath("/org/elasticsearch/test/unit/index/query/starColonStar.json");
|
||||||
|
Query parsedQuery = queryParser.parse(query).query();
|
||||||
|
assertThat(parsedQuery, instanceOf(ConstantScoreQuery.class));
|
||||||
|
ConstantScoreQuery constantScoreQuery = (ConstantScoreQuery) parsedQuery;
|
||||||
|
Filter internalFilter = constantScoreQuery.getFilter();
|
||||||
|
assertThat(internalFilter, instanceOf(MatchAllDocsFilter.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDisMaxBuilder() throws Exception {
|
public void testDisMaxBuilder() throws Exception {
|
||||||
IndexQueryParserService queryParser = queryParser();
|
IndexQueryParserService queryParser = queryParser();
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"query_string": {
|
||||||
|
"query": "*:*"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue