20690: Remove workbench1 and testing/packaging references.
[arvados.git] / apps / workbench / app / assets / javascripts / ilike_filters.js
diff --git a/apps/workbench/app/assets/javascripts/ilike_filters.js b/apps/workbench/app/assets/javascripts/ilike_filters.js
deleted file mode 100644 (file)
index 4f5cd48..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-// ilike_filters() converts a user-entered search query to a list of
-// filters using the newly added (as of Arvados 1.5) trigram indexes. It returns
-// [] (empty list) if it can't come up with anything valid (e.g., q consists
-// entirely of punctuation).
-//
-// Examples:
-//
-// "foo"     => [["any", "ilike", "%foo%"]]
-// "foo.bar" => [["any", "ilike", "%foo.bar%"]]                         // "." is a word char in ilike queries
-// "foo/b-r" => [["any", "ilike", "%foo/b-r%"]]                         // "/" and "-", too
-// "foo_bar" => [["any", "ilike", "%foo\\_bar%"]                        // "_" should be escaped so it can be used as a literal
-// "foo bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
-// "foo|bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
-// " oo|bar" => [["any", "ilike", "%oo%"], ["any", "ilike", "%bar%"]]
-// ""        => []
-// " "       => []
-// null      => []
-window.ilike_filters = function(q) {
-    q = (q || '').replace(/[^-\w\.\/]+/g, ' ').trim().replace(/_/g, '\\_')
-    if (q == '')
-        return []
-    return q.split(" ").map(function(term) {
-        return ["any", "ilike", "%"+term+"%"]
-    })
-}
\ No newline at end of file