mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-03 18:26:20 +00:00
Case insensitive search without search index
This commit is contained in:
parent
cbfed68c6b
commit
baa471e236
1 changed files with 5 additions and 3 deletions
|
@ -297,21 +297,23 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
if (state.matches.size() == 0)
|
if (state.matches.size() == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
String query = (criteria.query == null ? null : criteria.query.toLowerCase());
|
||||||
|
|
||||||
for (int i = state.index; i < state.matches.size() && found < pageSize && !state.destroyed; i++) {
|
for (int i = state.index; i < state.matches.size() && found < pageSize && !state.destroyed; i++) {
|
||||||
state.index = i + 1;
|
state.index = i + 1;
|
||||||
|
|
||||||
TupleMatch match = state.matches.get(i);
|
TupleMatch match = state.matches.get(i);
|
||||||
boolean matched = (match.matched != null && match.matched);
|
boolean matched = (match.matched != null && match.matched);
|
||||||
|
|
||||||
if (criteria.query != null) {
|
if (query != null) {
|
||||||
if (!matched && criteria.in_message)
|
if (!matched && criteria.in_message)
|
||||||
try {
|
try {
|
||||||
File file = EntityMessage.getFile(context, match.id);
|
File file = EntityMessage.getFile(context, match.id);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
String html = Helper.readText(file);
|
String html = Helper.readText(file);
|
||||||
if (html.toLowerCase().contains(criteria.query)) {
|
if (html.toLowerCase().contains(query)) {
|
||||||
String text = HtmlHelper.getFullText(html);
|
String text = HtmlHelper.getFullText(html);
|
||||||
if (text.toLowerCase().contains(criteria.query))
|
if (text != null && text.toLowerCase().contains(query))
|
||||||
matched = true;
|
matched = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue