Show search results when query string contains trailing space
The query expression used to search for a term prefix is the prefix itself with a '*' character appended to it. However, if query string contains trailing space, the query expresssion (e.g. "screen *") doesn't work. So to fix this issue, the unnecessary trailing space should be removed. Bug: 35231587 Test: manual - go to search in Settings and enter "screen " Change-Id: Ifa5d96f5d38ad5454272f140da440b8ff55d5614
This commit is contained in:
committed by
Yoshinori Hirano
parent
05c88316ec
commit
9973b01489
@@ -707,7 +707,7 @@ public class Index {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String buildSearchMatchStringForColumns(String query, String[] columnNames) {
|
private String buildSearchMatchStringForColumns(String query, String[] columnNames) {
|
||||||
final String value = query + "*";
|
final String value = (query != null ? query.trim() : "") + "*";
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
final int count = columnNames.length;
|
final int count = columnNames.length;
|
||||||
for (int n = 0; n < count; n++) {
|
for (int n = 0; n < count; n++) {
|
||||||
|
Reference in New Issue
Block a user