All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists matching topic search

Recently created
Least recently created
Recently updated
Least recently updated
gaiety's Avatar

gaiety / ecto-migration-search-pg_trgm

0 likes
0 forks
1 files
Last active 1752988367
ecto postgres search
1 defmodule MyProject.Repo.Migrations.ItemsSearch do
2 use Ecto.Migration
3
4 def up do
5 execute "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
6
7 execute """
8 CREATE INDEX items_search_index
9 ON items
10 USING gin ((name) gin_trgm_ops);
gaiety's Avatar

gaiety / ecto-search-simple-word-similarity.ex

0 likes
0 forks
1 files
Last active 1753036694
ecto elixir phoenix search
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 )
Newer Older

Powered by Opengist ⋅ Load: 113ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ Links ⋅ Portfolio ⋅ Git