Pregunta
¿Cómo crear un único filtro de búsqueda con comodines que permita buscar mediante varias palabras clave no consecutivas?
Por ejemplo, una búsqueda de "esfinge de cuarzo" debería mostrar "Esfinge de cuarzo blanco, juzguen mi voto".
¿Cómo crear un único filtro de búsqueda con comodines que permita buscar mediante varias palabras clave no consecutivas?
Por ejemplo, una búsqueda de "esfinge de cuarzo" debería mostrar "Esfinge de cuarzo blanco, juzguen mi voto".
[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))))