473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

tsearch2 question...

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..

In order for this to work well, it would seem that I need the same code
path as that used to generate the headline to begin with, otherwise
differences in stemming/etc could cause mis-matches...

My thought was to do:

SELECT bodytext_id,headline(bodytext,
to_tsquery('default','SEARCH_KEYS'),'
MaxWords=999999999,MinWords=999999999,ShortWord=0' ) FROM some_table WHERE
bodytext_id=SOME_ID

Does this seem like a 'reasonable' way to do this?... In not is there a
better way that you can think of?...

Thanks!

- GReg
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
1 1134


Net Virtual Mailing Lists wrote:
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..

In order for this to work well, it would seem that I need the same code
path as that used to generate the headline to begin with, otherwise
differences in stemming/etc could cause mis-matches...

My thought was to do:

SELECT bodytext_id,headline(bodytext,
to_tsquery('default','SEARCH_KEYS'),'
MaxWords=999999999,MinWords=999999999,ShortWord=0' ) FROM some_table WHERE
bodytext_id=SOME_ID

Does this seem like a 'reasonable' way to do this?... In not is there a
better way that you can think of?...


Big value of MinWord is right way.
--
Teodor Sigaev E-mail: te****@sigaev.ru
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
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...
1
by: psql-mail | last post by:
I have applied the recent tsearch2 patch and recompiled the tsearch2 module but I am still experiencing the same backend crashes as I previously described. Thanks for any help, Mat GDB...
0
by: konf | last post by:
Well, now I tried to compile with tsearch2. I do in src direcotry: ../configure then change into contrib/tsearch2 and do make (as I read in manual) and I got:
9
by: Pavel Stehule | last post by:
Hello I try tsearch2 within czech environment. It is works fine, but I have two questions. 1. I have words "se", "ve" in my czech stop words. But I get this words in result. Why? Have I...
2
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...
0
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...
3
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/...
2
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...
1
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',...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.