In a Rails app I'm using the pg_search gem. When I run my RSpec suite I see many lines of:

NOTICE:  text-search query doesn't contain lexemes: ""
LINE 1: ...e("pg_search_documents"."content"::text, '')))), (''), 0)) A...

I'm not sure what this means, or whether it's something I should be concerned about.

Can anyone help?

有帮助吗?

解决方案

I'm the author and maintainer of pg_search.

That message means that your search query ended up having no words in it. Thus, PostgreSQL is warning you that you won't get any results, and the query is not that useful.

It's safe to ignore. pg_search always sends the query to the database, even in edge cases like this where the query is meaningless. If you really want to avoid it, you could add logic to your application to detect blank queries and not call through to the pg_search scope.

其他提示

In rails 3.2.2 I used this in My database.yml for getting rid of the notice messages from postgres.

test:
  min_messages: warning
  #... default configurations...
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top