Last active 10 months ago

gaiety's Avatar gaiety revised this gist 10 months ago. Go to revision

No changes

gaiety's Avatar gaiety revised this gist 10 months ago. Go to revision

1 file changed, 11 insertions

ecto-search-simple-word-similarity.ex(file created)

@@ -0,0 +1,11 @@
1 + defp items_search(search) do
2 + dynamic(
3 + [item],
4 + fragment(
5 + "word_similarity(?, CONCAT(?, ' ', ?)) > 0.6",
6 + ^search,
7 + item.name,
8 + item.description
9 + )
10 + )
11 + end
Newer Older