gaiety revised this gist 3 months ago. Go to revision
No changes
gaiety revised this gist 3 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