Skip to content

Commit da43576

Browse files
authored
Merge pull request #4876 from gchq/gh-4875
#4875 Fix select *
2 parents 0b000c0 + 717fd90 commit da43576

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

stroom-query/stroom-query-common/src/main/java/stroom/query/language/SearchRequestFactory.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,22 @@ private void expandStarredField(final Map<String, Sort> sortMap,
12001200
final String fieldNameFilter) {
12011201
final DocRef dataSource = queryBuilder.build().getDataSource();
12021202
if (dataSource != null) {
1203+
String filter = fieldNameFilter;
1204+
1205+
// Create a regex name filter if the user has used a *.
1206+
if (filter.equals("*")) {
1207+
filter = null;
1208+
} else if (filter.contains("*")) {
1209+
filter = filter.replaceAll("\\*", ".*");
1210+
filter = filter.replaceAll("\\?", ".?");
1211+
filter = "/" + filter;
1212+
}
1213+
12031214
final FindFieldCriteria criteria = new FindFieldCriteria(
12041215
PageRequest.createDefault(),
12051216
FindFieldCriteria.DEFAULT_SORT_LIST,
12061217
dataSource,
1207-
fieldNameFilter,
1218+
filter,
12081219
null);
12091220
final ResultPage<QueryField> resultPage = queryFieldProviderProvider.get().findFields(criteria);
12101221
final List<QueryField> fields = resultPage.getValues();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
* Issue **#4875** : Fix select *.
2+
3+
4+
```sh
5+
# ********************************************************************************
6+
# Issue title: `Select *` doesn't work on Indices
7+
# Issue link: https://github.com/gchq/stroom/issues/4875
8+
# ********************************************************************************
9+
10+
# ONLY the top line will be included as a change entry in the CHANGELOG.
11+
# The entry should be in GitHub flavour markdown and should be written on a SINGLE
12+
# line with no hard breaks. You can have multiple change files for a single GitHub issue.
13+
# The entry should be written in the imperative mood, i.e. 'Fix nasty bug' rather than
14+
# 'Fixed nasty bug'.
15+
#
16+
# Examples of acceptable entries are:
17+
#
18+
#
19+
# * Issue **123** : Fix bug with an associated GitHub issue in this repository
20+
#
21+
# * Issue **namespace/other-repo#456** : Fix bug with an associated GitHub issue in another repository
22+
#
23+
# * Fix bug with no associated GitHub issue.
24+
```

0 commit comments

Comments
 (0)