I have below plainto_tsquery
query as part of full text searching on a PostgreSQL table.
SELECT plainto_tsquery('english', 'flat discount on flight_tickets');
This query will return 'flat' & 'discount' & 'flight' & 'ticket'
Is there any way to make it to return 'flat' & 'discount' & 'flight_ticket'
Just to avoid closing ticket by marking as duplicate, I have checked below stackoverflow questions
You could "pre-process" the text and the queries to replace _
with a different character like /
.
CREATE INDEX ON texts USING gin (to_tsvector('english', replace(doc, '_', '/')));
SELECT * FROM texts
WHERE to_tsvector('english', replace(doc, '_', '/'))
@@ plainto_tsquery('english', replace('flat discount on flight_tickets', '_', '/'));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With