From: | Michael Nacos <m(dot)nacos(at)gmail(dot)com> |
---|---|
To: | Jonathan <jharahush(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Full Text Search 101? |
Date: | 2009-11-12 21:02:39 |
Message-ID: | 407fa4640911121302t63a3337cv3526febf8d496c46@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
there's a lot of material on this site:
http://www.sai.msu.su/~megera/wiki/tsearch2slides
how do you create your tsvectors? If all your results have the same score
(assuming you are using two or more tokens in your tsquery) it might be that
your tsvector lacks positional information ('a b'::tsvector vs 'a:1,5
b:3'::tsvector) and/or weights. I have experienced similar behaviour when
doing searches against such tsvectors. Using rank_cd instead of rank might
help you even then, I think. My understanding is that if you want to use
weights in your tsvectors you have to set them yourself (you may concatenate
tsvectors from different locations if you want, after using set_weight on
some of them).
hope this helps a bit, Michael
2009/11/12 Jonathan <jharahush(at)gmail(dot)com>
> Hi everyone,
>
> I posted to this forum once before and was able to receive help.
> Thanks again!
>
> I'm trying to implement full text search capabilities. Basically, I
> have a very simple "data catalog" type of website (http://
> gis.drcog.org/datacatalog) where the user can type in a word or words
> to search for records that match the criteria. I have a table with a
> few fields, but I want to be able to search/index two fields -- the
> "name" of the dataset and the "description." (or more, if I can index
> fields from other tables too, that would be great). I'd like to be
> able to use a full text search to rank the results in terms of
> relevance.
>
> What is the best way to handle this? I've read through the PostgreSQL
> documentation and don't quite understand it although I'm trying to
> understand and am 'playing around' with this on a development server.
> Is the default text search configuration enough? I've tried setting my
> own configuration but get errors about not finding .dict dictionary
> files? I have a default install of PostgreSQL 8.4.
>
> Also, I've created a tsvector column and created indexes, but it
> didn't seem to delete stop words from the indexes. Should the stop
> words be indexed?
>
> Also, I don't quite understand how to create indexes but rank certain
> words as being more important than others, for instance, maybe having
> words that come from the "name" column carrying more importance than
> words coming from the "description" column. Finally, I'd like
> "watersheds" to come up when someone searches for "water" so I don't
> think I have this configured properly, because this record is not
> returned.
>
> Is there a good tutorial or maybe documentation that is a bit easier
> to understand? I know my database is far from complicated but I can't
> seem to find a configuration that works well. When I try ranking my
> results, most of the results end up with the same rank, so something
> must be wrong?
>
> Can someone point me in the right direction?
>
> Thanks for the help. I appreciate it.
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Aurynn Shaw | 2009-11-12 21:29:46 | Re: Full Text Search 101? |
Previous Message | Jonathan | 2009-11-12 19:13:58 | Full Text Search 101? |