Implements search for custom fields closes #196 #266
1 changed files with 2 additions and 3 deletions
|
|
@ -515,14 +515,13 @@ defmodule Mv.Membership.Member do
|
||||||
# Builds substring search filter for structured fields
|
# Builds substring search filter for structured fields
|
||||||
# Note: contains/2 uses ILIKE '%value%' which is not index-optimized
|
# Note: contains/2 uses ILIKE '%value%' which is not index-optimized
|
||||||
# Performance: Good for small datasets, may be slow on large tables
|
# Performance: Good for small datasets, may be slow on large tables
|
||||||
defp build_substring_filter(query, pattern) do
|
defp build_substring_filter(query, _pattern) do
|
||||||
expr(
|
expr(
|
||||||
contains(postal_code, ^query) or
|
contains(postal_code, ^query) or
|
||||||
contains(house_number, ^query) or
|
contains(house_number, ^query) or
|
||||||
contains(phone_number, ^query) or
|
contains(phone_number, ^query) or
|
||||||
contains(email, ^query) or
|
contains(email, ^query) or
|
||||||
contains(city, ^query) or
|
contains(city, ^query)
|
||||||
ilike(city, ^pattern)
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue