You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using the pg_search_scope method to construct a search against 3 columns in my primary model (Chemical) and 2 columns in an associated model (Component) a many-to-many with a join.
I am also using a combination of the trigram feature (enabled through a migration) and the tsearch feature.
The issue I have discovered is that after adding both features and configuring them certain columns in the primary model ignore the trigram feature. I may be misunderstanding the documentation, but I tried my best to follow it as closely as possible. Any help would be appreciated.
chemical1 = Chemical.create(chem_code: 'RM123', sample_identifier: 'AX123', name: 'Aloe Serum')
chemical2 = Chemical.create(chem_code: 'RMAG03-B', sample_identifier: 'AX234', name: 'Glycerin Extract' )
example 1 -
Chemical.search_for('serum') # here I would expect the query to match against 'Aloe Serum' (from chemical1)
expectation => [chemical1]
reality => []
example 2 -
Chemical.search_for('G03-B') # here my expectation is that it will use trigram to match against the chem_code
expectation => [chemical2]
reality => []
Can anyone tell me if there is something glaringly wrong with my setup or what i'm doing that I may be missing?
Thanks and really appreciate all the hard work you've put into this gem so far!
The text was updated successfully, but these errors were encountered:
sotek222
changed the title
pg_search_scope some columns ignore search feature
pg_search_scope - some columns ignore search feature
Oct 21, 2022
Hi there,
I am currently using the
pg_search_scope
method to construct a search against 3 columns in my primary model (Chemical
) and 2 columns in an associated model (Component
) a many-to-many with a join.I am also using a combination of the
trigram
feature (enabled through a migration) and thetsearch
feature.The issue I have discovered is that after adding both features and configuring them certain columns in the primary model ignore the
trigram
feature. I may be misunderstanding the documentation, but I tried my best to follow it as closely as possible. Any help would be appreciated.Environment -
Primary model (
Chemical
)Example of weird results -
Can anyone tell me if there is something glaringly wrong with my setup or what i'm doing that I may be missing?
Thanks and really appreciate all the hard work you've put into this gem so far!
The text was updated successfully, but these errors were encountered: