Skip to content

Commit 9ddc5ef

Browse files
author
Sebastian Mate
committed
Fix search function
Update docu
1 parent dc24459 commit 9ddc5ef

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed
Binary file not shown.
88 Bytes
Binary file not shown.

source/MIRACUM Mapper/mapperForm.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,32 +696,36 @@ private void loadSourceTerms() // Load the source terms list on the left side of
696696
reader.Close();
697697

698698
string textFilter = "";
699+
string wordFilter = "";
700+
699701
if (!sourceFilter.Text.Equals(""))
700702
{
701703
string[] words = sourceFilter.Text.Split(' ');
702704
for (int a = 0; a < words.Length; a++)
703705
{
706+
wordFilter = "";
704707
String sWord = words[a].ToUpper();
705708
if (!sWord.Contains("%"))
706709
{
707710
sWord = "%" + sWord + "%";
708711
}
709712

710713
if (searchSource.Checked)
711-
textFilter = textFilter + " upper(source_code) SIMILAR TO'" + sWord + "' ";
714+
wordFilter = wordFilter + " upper(source_code) ";
715+
716+
if (searchTarget.Checked)
717+
wordFilter = wordFilter + " upper(target_code) ";
712718

713719
if (searchInfo.Checked)
714-
textFilter = textFilter + " upper(source_desc) SIMILAR TO '" + sWord + "' ";
720+
wordFilter = wordFilter + " upper(source_desc) ";
715721

716722
if (searchDoku.Checked)
717-
textFilter = textFilter + " upper(documentation) SIMILAR TO '" + sWord + "' ";
718-
719-
if (searchTarget.Checked)
720-
textFilter = textFilter + " upper(target_code) SIMILAR TO '" + sWord + "' ";
721-
722-
if (!textFilter.Equals(""))
723-
textFilter = "AND (" + textFilter.Trim().Replace(" ", " OR ") + ")";
723+
wordFilter = wordFilter + " upper(documentation) ";
724724

725+
if (!wordFilter.Equals(""))
726+
wordFilter = "AND " + wordFilter.Trim().Replace(" ", " || ") + " SIMILAR TO '" + sWord + "' ";
727+
728+
textFilter = textFilter + wordFilter;
725729
}
726730
}
727731

0 commit comments

Comments
 (0)