Skip to content

Commit 6be5b05

Browse files
authored
Revert addition of wildcard field in 7.8 (#56331)
We've chosen to delay the release of the wildcard field, pending further development and testing
1 parent f66ab98 commit 6be5b05

File tree

13 files changed

+7
-1401
lines changed

13 files changed

+7
-1401
lines changed

docs/reference/mapping/types.asciidoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ document:
77
[float]
88
=== Core datatypes
99

10-
string:: <<text,`text`>>, <<keyword,`keyword`>> and <<wildcard,`wildcard`>>
10+
string:: <<text,`text`>> and <<keyword,`keyword`>>
1111
<<number>>:: `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`
1212
<<date>>:: `date`
1313
<<date_nanos>>:: `date_nanos`
@@ -135,5 +135,3 @@ include::types/token-count.asciidoc[]
135135
include::types/shape.asciidoc[]
136136

137137
include::types/constant-keyword.asciidoc[]
138-
139-
include::types/wildcard.asciidoc[]

docs/reference/mapping/types/wildcard.asciidoc

Lines changed: 0 additions & 68 deletions
This file was deleted.

server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,14 @@ public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int
369369
}
370370

371371
public Query prefixQuery(String value, @Nullable MultiTermQuery.RewriteMethod method, QueryShardContext context) {
372-
throw new QueryShardException(context, "Can only use prefix queries on keyword, text and wildcard fields - not on [" + name
372+
throw new QueryShardException(context, "Can only use prefix queries on keyword and text fields - not on [" + name
373373
+ "] which is of type [" + typeName() + "]");
374374
}
375375

376376
public Query wildcardQuery(String value,
377377
@Nullable MultiTermQuery.RewriteMethod method,
378378
QueryShardContext context) {
379-
throw new QueryShardException(context, "Can only use wildcard queries on keyword, text and wildcard fields - not on [" + name
379+
throw new QueryShardException(context, "Can only use wildcard queries on keyword and text fields - not on [" + name
380380
+ "] which is of type [" + typeName() + "]");
381381
}
382382

server/src/main/java/org/elasticsearch/index/query/QueryBuilders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public static RangeQueryBuilder rangeQuery(String name) {
264264
* which matches any single character. Note this query can be slow, as it
265265
* needs to iterate over many terms. In order to prevent extremely slow WildcardQueries,
266266
* a Wildcard term should not start with one of the wildcards {@code *} or
267-
* {@code ?}. (The wildcard field type however, is optimised for leading wildcards)
267+
* {@code ?}.
268268
*
269269
* @param name The field name
270270
* @param query The wildcard query string

server/src/test/java/org/elasticsearch/index/query/PrefixQueryBuilderTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void testNumeric() throws Exception {
116116
QueryShardContext context = createShardContext();
117117
QueryShardException e = expectThrows(QueryShardException.class,
118118
() -> query.toQuery(context));
119-
assertEquals("Can only use prefix queries on keyword, text and wildcard fields - not on [mapped_int] which is of type [integer]",
119+
assertEquals("Can only use prefix queries on keyword and text fields - not on [mapped_int] which is of type [integer]",
120120
e.getMessage());
121121
}
122122

@@ -145,7 +145,7 @@ public void testParseFailsWithMultipleFields() throws IOException {
145145
e = expectThrows(ParsingException.class, () -> parseQuery(shortJson));
146146
assertEquals("[prefix] query doesn't support multiple fields, found [user1] and [user2]", e.getMessage());
147147
}
148-
148+
149149
public void testRewriteIndexQueryToMatchNone() throws Exception {
150150
PrefixQueryBuilder query = prefixQuery("_index", "does_not_exist");
151151
QueryShardContext queryShardContext = createShardContext();

server/src/test/java/org/elasticsearch/index/query/QueryStringQueryBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ public void testPrefixNumeric() throws Exception {
816816
QueryShardContext context = createShardContext();
817817
QueryShardException e = expectThrows(QueryShardException.class,
818818
() -> query.toQuery(context));
819-
assertEquals("Can only use prefix queries on keyword, text and wildcard fields - not on [mapped_int] which is of type [integer]",
819+
assertEquals("Can only use prefix queries on keyword and text fields - not on [mapped_int] which is of type [integer]",
820820
e.getMessage());
821821
query.lenient(true);
822822
query.toQuery(context); // no exception

x-pack/plugin/src/test/resources/rest-api-spec/test/wildcard/10_wildcard_basic.yml

Lines changed: 0 additions & 238 deletions
This file was deleted.

x-pack/plugin/wildcard/build.gradle

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)