473,657 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tsearch2 indexing question....

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
1 1240
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**********@ne t-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.r u
---------------------------(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2637
by: Alexander Rüegg | last post by:
Hi, Is it possible to get all the positions of a lexeme in a result-set of a query? For example, we have the table TEXT TEXT_IDX 'TSearch2 is very cool' ... 'It would be much cooler with lexeme positions'
13
2862
by: Nigel J. Andrews | last post by:
This will be a little vague, it was last night and I can't now do the test in that db (see below) so can't give the exact wording. I seem to remember a report a little while ago about tsearch v2 causing unexpected backend exit messages with 7.3.4 and now I'm getting similar messages unpredictably and I can't find the thread in the archives either. What I did was install tsearch2 using share/contrib/tsearch2.sql, which placed everything...
1
1145
by: Net Virtual Mailing Lists | last post by:
Hello, I have a quick question regarding tsearch2, hopefully this is an okay place to ask because I couldn't find a tsearch2-specific mailing list.. Anyways, when the field which is indexed using tsearch2 is displayed in it's entirety I want the searched keywords to be highlighted, just as in a headline except that the entire document gets displayed instead of just a summary of it..
16
1845
by: Ben | last post by:
I'm trying to make myself a dictionary for tsearch2 that converts numbers to their english word equivalents. This seems to be working great, except that I can't figure out how to make my lexize function return multiple lexemes. For instance, I'd like "100" to get converted to {one,hundred}, not {"one hundred"} as is currently happening. How do I specify the output of the lexize function so that this will happen?
2
3684
by: Fischer Ulrich | last post by:
Hi I have a problem with the restoring of a database which uses tsearch2. I made a backup as discribed in 'tsearch-v2-intro' on the tsearch2 page. Now i'm trying to restore it into a testdatabase. The problem is, that the entries of the relations 'pg_ts_cfg', 'pg_ts_cfgmap', 'pg_ts_dict' and 'pg_ts_parser' are not correctly restored. I get errors like: psql:restoretest.out:28223: ERROR: copy: line 1, Cannot insert a duplicate key...
0
2096
by: Markus Wollny | last post by:
Hi! Sorry to bother you, but I just don't know how to get tsearch2 configured correctly for my setup. I've got a 7.4.3 database-cluster initdb'ed with de_DE@euro as locale, the database is with Unicode encoding. I made and installed contrib/tsearch2 after installing the dump/reload-patch http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/regprocedure_7.4.patch.gz as advised by the docs. So far everything is looking good, I have...
3
4589
by: Marcel Boscher | last post by:
Hello everybody, i tried to "J.U.S.T" install the FullTextSearchTool tsearch2 under the guidiance of : http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ <http://www.sai.msu.su/%7Emegera/postgres/gist/tsearch/V2/> and i'm almost losing my mind... <runningagainstwallheadsfirst> after i installed postgre which works fine i change to the folder /contrib/tsearch2/
2
3321
by: Net Virtual Mailing Lists | last post by:
Hello, If I have a rule like this: CREATE OR REPLACE RULE sometable_update AS ON UPDATE TO table2 DO UPDATE cache SET updated_dt=NULL WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_insert AS ON INSERT TO table2 DO UPDATE cache SET updated_dt=NULL WHERE tablename='sometable'; CREATE OR REPLACE RULE sometable_delete AS ON DELETE TO table2 DO UPDATE
1
2506
by: Dawid Kuroczko | last post by:
I'm trying to use tsearch2 with database which is in 'UNICODE' encoding. It works fine for English text, but as I intend to search Polish texts I did: insert into pg_ts_cfg('default_polish', 'default', 'pl_PL.UTF-8'); (and I updated other pg_ts_* tables as written in manual). However, Polish-specific chars are being eaten alive, it seems. I.e. doing select to_tsvector('default_polish', body) from messages; results in list of words but...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.