Use FTS if enabled for external search, cleanup

pull/194/head
M66B 4 years ago
parent 46bf310300
commit 064ee0ba48

@ -1094,9 +1094,17 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
String search = (csearch == null ? null : csearch.toString());
if (!TextUtils.isEmpty(search)) {
searching = true;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean fts = prefs.getBoolean("fts", false);
BoundaryCallbackMessages.SearchCriteria criteria = new BoundaryCallbackMessages.SearchCriteria();
criteria.query = search;
criteria.fts = fts;
FragmentMessages.search(
ActivityView.this, ActivityView.this, getSupportFragmentManager(),
-1, -1, false, new BoundaryCallbackMessages.SearchCriteria(search));
-1, -1, false, criteria);
}
intent.removeExtra(Intent.EXTRA_PROCESS_TEXT);

@ -657,24 +657,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
Long after = null;
Long before = null;
SearchCriteria() {
}
SearchCriteria(String query) {
this.query = query;
}
boolean isExpression() {
if (this.query == null)
return false;
for (String w : this.query.trim().split("\\s+"))
if (w.length() > 1 && "+-?".indexOf(w.charAt(0)) >= 0)
return true;
return false;
}
SearchTerm getTerms(boolean utf8, Flags flags, String[] keywords) {
List<SearchTerm> or = new ArrayList<>();
List<SearchTerm> and = new ArrayList<>();

Loading…
Cancel
Save