From 6f4509822f331e4fbe51e2fc92a377ad77661f34 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 19 Aug 2023 19:40:17 +0200 Subject: [PATCH] Search via index: whole words only --- .../eu/faircode/email/FragmentDialogSearch.java | 4 ++++ app/src/main/res/layout/dialog_search.xml | 14 +++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogSearch.java b/app/src/main/java/eu/faircode/email/FragmentDialogSearch.java index 4ab9d21c09..e355d0d16c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogSearch.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogSearch.java @@ -105,6 +105,7 @@ public class FragmentDialogSearch extends FragmentDialogBase { ImageButton ibInvite = dview.findViewById(R.id.ibInvite); ImageButton ibAttachment = dview.findViewById(R.id.ibAttachment); ImageButton ibNotes = dview.findViewById(R.id.ibNotes); + TextView tvHintFts = dview.findViewById(R.id.tvHintFts); ibMore = dview.findViewById(R.id.ibMore); tvMore = dview.findViewById(R.id.tvMore); CheckBox cbSearchIndex = dview.findViewById(R.id.cbSearchIndex); @@ -252,6 +253,8 @@ public class FragmentDialogSearch extends FragmentDialogBase { } }); + tvHintFts.setVisibility(last_fts && fts && pro ? View.VISIBLE : View.GONE); + View.OnClickListener onMore = new View.OnClickListener() { @Override public void onClick(View v) { @@ -288,6 +291,7 @@ public class FragmentDialogSearch extends FragmentDialogBase { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { prefs.edit().putBoolean("last_fts", isChecked).apply(); + tvHintFts.setVisibility(isChecked && fts && pro ? View.VISIBLE : View.GONE); } }); diff --git a/app/src/main/res/layout/dialog_search.xml b/app/src/main/res/layout/dialog_search.xml index 9a43594707..075343518c 100644 --- a/app/src/main/res/layout/dialog_search.xml +++ b/app/src/main/res/layout/dialog_search.xml @@ -207,6 +207,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/btnSearch1" /> + + + Search via index: whole words only Searching via the search index is fast, but only finds whole words. Searching for text in messages, when there are a large number of messages, might not work on some servers \'%s\' means that the mail server doesn\'t support searching in message texts