10

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?

Grant Hutchins
  • 4,275
  • 1
  • 27
  • 32
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185

2 Answers2

12

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.

Grant Hutchins
  • 4,275
  • 1
  • 27
  • 32
2

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...
chopi321
  • 1,383
  • 1
  • 11
  • 23
  • thanks chopi321, that's useful advice. Do you know what these messages mean? – Andy Harvey Jul 21 '12 at 06:11
  • Sorry for my late reply as @nertzy said, "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." – chopi321 Mar 15 '13 at 01:41