diff --git a/AtlasLoot/Core/Search.lua b/AtlasLoot/Core/Search.lua index 2b707dc..c1d2a77 100644 --- a/AtlasLoot/Core/Search.lua +++ b/AtlasLoot/Core/Search.lua @@ -468,7 +468,13 @@ function AtlasLoot:Search(Text) local found; if partial then - found = string.find(string.lower(itemName), text); + local res = SplitString(text, " "); + for _, t in ipairs(res) do + found = string.find(string.lower(itemName), t); + if not found then + break; + end + end else found = string.lower(itemName) == text; end diff --git a/AtlasLoot/Core/SearchAdvanced.lua b/AtlasLoot/Core/SearchAdvanced.lua index 97989df..fcb0007 100644 --- a/AtlasLoot/Core/SearchAdvanced.lua +++ b/AtlasLoot/Core/SearchAdvanced.lua @@ -847,7 +847,7 @@ function AtlasLoot:AdvancedSearch(Text, arg1, arg2, arg3) end local function SplitString(str, delimiter) - result = {}; + local result = {}; for match in (str..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match); end @@ -1138,7 +1138,13 @@ function AtlasLoot:AdvancedSearch(Text, arg1, arg2, arg3) if findByName and found then if partial then - found = string.find(string.lower(itemName), text); + local res = SplitString(text, " "); + for _, t in ipairs(res) do + found = string.find(string.lower(itemName), t); + if not found then + break; + end + end else found = string.lower(itemName) == text; end