By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,178 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,178 IT Pros & Developers. It's quick & easy.

Tsearch2 indexing question....

P: n/a
Hello,

First of all I want to say that I really like this tsearch2 - it's a
really great addition to Postgres!..

I am having one minor issue with it and I just can't quite figure out the
best way to solve it...

Basically I had a user enter the following string "Executive
Assistant/Network Manager"... I am unable to find this data by doing a
search for "Assistant" or "Network"... I guess this is due to the "/"
between the two words... In any event, is there an easy solution to
this?..

- Greg

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Easy way:
comment out in wordparser/parser.l:
[[:alnum:]\./_-]+"/"[[:alnum:]\./_-]+ {
token = tsearch2_yytext;
tokenlen = tsearch2_yyleng;
return FILEPATH;
}

but lexeme as '/usr/local/bin/perl' will be indexed as usr, local, lib, perl.
Remember, after recompile and install, you should reindex text data.

Complex way: write your own parser.
ma**********@net-virtual.com wrote:
Hello,

First of all I want to say that I really like this tsearch2 - it's a
really great addition to Postgres!..

I am having one minor issue with it and I just can't quite figure out the
best way to solve it...

Basically I had a user enter the following string "Executive
Assistant/Network Manager"... I am unable to find this data by doing a
search for "Assistant" or "Network"... I guess this is due to the "/"
between the two words... In any event, is there an easy solution to
this?..

- Greg

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match


--
Teodor Sigaev E-mail: te****@sigaev.ru
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.