4

is this a bug or a feature? I've created an index on a tsvector attribute (without using a dictionary).

The query

SELECT title
FROM table
WHERE title_tsv @@ to_tsquery('basic') and
title_tsv @@ to_tsquery('inst:*')

returns "Basic Instinct". However, the query

SELECT title
FROM table
WHERE title_tsv @@ to_tsquery('basic') and
title_tsv @@ to_tsquery('in:*')

returns no records at all. I don't see why the second (more generic query) returns less results then the first query?

Bye

1 Answer 1

4
steve@steve@[local] =# select to_tsquery('in:*');
NOTICE:  text-search query contains only stop words or doesn't contain lexemes, ignored

so presumably matching against that query always returns false?

Maybe you want to be making a single query of the form 'basic & in:*' ?

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks a lot for your help! One follow up question: if I don't use a dictionary, does this not mean that PostgreSQL doesn't use a stop-word list too?
if you don't specify a configuration, it simply uses the default, which might be 'english' (i.e. English stopwords). Try specifying a configuration of 'simple' instead, or create a new configuration with English lexical analysis but an empty dictionary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.