Hello,
You have a bit of misunderstanding regarding Base. Field types shown in Base are only shown because of the database you have chosen. If you were using the HSQLDB embedded database you would not find type memo [tsvector]
. Thisis the main reason you do not find a reference in the Base documentation. The documentation does cover some on fields especially on the embedded databases. In general, however, it is best to refer to the documentation of the database you are using.
Had not seen or used this field type until a short time ago. It does seem to work with Base but there are certainly items I do not fully comprehend yet. Here is what worked for me.
Set up what I thought was similar to your question:
Entered some data:
Note that I am still learning the construct of a ‘tsvector’ field and some of the converted text is truncated. This does not affect the testing.
Then here is the SQL result you presented in the question:
Here are the liked pages I used to come up with this:
Edit:
Just noticed my sample did not use plainto_tsquery
so here is a test with that (also added weights during my testing):
Here is how I have been updating the tsvector
field:
UPDATE headers SET
document_with_weights = setweight(to_tsvector(name), 'A') ||
setweight(to_tsvector(ingredients),'B') ||
setweight(to_tsvector(method),'C');
If this answers your question please tick the (upper left area of answer). It helps others to know there was an accepted answer.