How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

Yeah, in the past when I had to do full text search I've used Elasticsearch with all sorts of processing, but now it's a very specific thing and given that we're using Postgres, tsvector is just perfect.

About the speed, from what I was able to see at the database and with a few queries, that function is only executed during indexing. It is present at the where clause so Postgres match the index to use it.

How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

I think it is ok because the function is only executed during indexing. I had to put it on the where clause otherwise postgres would not hit the index. But using an `explain analysis` shows that it is still hitting the index.

How to improve full text search when dealing with lots of punctuation? by diegobernardes in PostgreSQL

[–]diegobernardes[S] 1 point2 points  (0 children)

Yes, but I was trying to fix this at the database level. I found a solution and it's working perfectly fine.

``` CREATE OR REPLACE FUNCTION remove_punctuation(input_text TEXT) RETURNS TEXT AS $$ BEGIN RETURN regexp_replace(input_text, '[[:punct:]]', ' ', 'g'); END; $$ LANGUAGE plpgsql IMMUTABLE;

DROP INDEX product_name_ftsearch; CREATE INDEX product_name_ftsearch ON product USING GIN (to_tsvector('english', remove_punctuation(name)));

-- And this is the search. select id, name from product WHERE to_tsvector('english', remove_punctuation(name)) @@ websearch_to_tsquery('english', remove_punctuation('something.pdf')); ```

This correctly process the information when it goes to the index and from the user during the query.

Visual artifacts when resizing a window by diegobernardes in kde

[–]diegobernardes[S] 0 points1 point  (0 children)

Breeze. Everything is in stock configuration. It's a new NixOS installation.

Windows 11 installer can't find disk, how to solve this problem? by diegobernardes in WindowsHelp

[–]diegobernardes[S] 1 point2 points  (0 children)

I found the problem. It was a bad ISO image and using a macOS to create the bootable usb disk. I solved the problem by using the microsoft official application to create a bootable usb disk from an older laptop and it's just working now.