Question
How to create a single wildcard search filter that allows searching by multiple keywords that are not consecutive.
For example, a search on "quartz sphinx" should return "Sphinx of black quartz, judge my vow."
How to create a single wildcard search filter that allows searching by multiple keywords that are not consecutive.
For example, a search on "quartz sphinx" should return "Sphinx of black quartz, judge my vow."
[Search Product Name]="" //show everything if the parameter is blank, aka everything is TRUE OR ( CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",1))) //if [Product Name] contains the first typed search term AND ( SPLIT([Search Product Name]," ",2) = "" //if there isn't a second search term, just return TRUE OR CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",2))) //check that the second search term is also in [Product Name] ) AND (SPLIT([Search Product Name]," ",3)="" OR CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",3)))) AND (SPLIT([Search Product Name]," ",4)="" OR CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",4)))) AND (SPLIT([Search Product Name]," ",5)="" OR CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",5)))) )
[Search Product Name]=""
OR CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",1)))
OR (
NOT SPLIT([Search Product Name]," ",2)=""
AND CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",2)))
) //If the 2nd search term is NOT blank and is contained in [Product Name] then return TRUE
OR (NOT SPLIT([Search Product Name]," ",3)="" AND CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",3))))
OR (NOT SPLIT([Search Product Name]," ",4)="" AND CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",4))))
OR (NOT SPLIT([Search Product Name]," ",5)="" AND CONTAINS(LOWER([Product Name]),LOWER(SPLIT([Search Product Name]," ",5))))