views:

257

answers:

2

I'm using PostgreSQL full text search for a project where traditional stop words ('a', 'the', 'if' etc.) should be indexed and searchable, which is not the default behaviour. For example, I might want my users to find results for the query 'to be or not to be'.

The documentation indicates that I could achieve this by creating an empty stopwords dictionary in $SHAREDIR/tsearch_data/english.stop (for example), but this will complicate deployment; I want to be able to configure PostgreSQL's stop word handling with SQL. Is this possible? If so, can you provide a sample SQL statement?

+1  A: 

No, the stop words are only configurable through that file. You can have a server side function that modifies the file, but that requires the file to be write:able by the postgres service user, which you probably don't want.

Magnus Hagander
OK, thanks. To be clear - it's not possible to tell PostgreSQL to not use *any* stopwords file?
tomd
+3  A: 
catchdave
Thanks, catchdave - that's what I was looking for.
tomd