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'
Our query is
SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery ;
^^^^^^^^
The result should be something like:
'TSearch2 is very cool', 4
'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a
single entry?
thanks
Alex
--
Dipl.-Inform. Alexander Rueegg
Bioinformatics Department Faculty of Technology
Bielefeld University
Phone: +49 (0)521-106-3541
Fax: +49 (0)521-106-6488
Room: C02-206
Email: ar*****@techfak .uni-bielefeld.de
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org 4 2646
Alexander Rüegg wrote: 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'
Our query is SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery ; ^^^^^^^^ The result should be something like: 'TSearch2 is very cool', 4 'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a single entry?
You can write such function, but why do you need it? May be there is more simple
way to resolve your problem?
BTW, lexeme can have more that one position...
--
Teodor Sigaev E-mail: te****@sigaev.r u
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Thank you for your response.
We want to know the distance or sequence of words in a set of
text-entries. So first we try to retrieve the text-entries in which the
words appear using tsearch indexing. After that we want to calculate the
positions of the words in each entry, e.g. parsing the index column of
the retrieved text-entries.
Maybe there exists a function or an easier/cheaper way to get this
information (and which considers that the words maybe occur more than once).
thanks,
Alex
Teodor Sigaev wrote:
Alexander Rüegg wrote:
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'
Our query is SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery ; ^^^^^^^^ The result should be something like: 'TSearch2 is very cool', 4 'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a single entry?
You can write such function, but why do you need it? May be there is more simple way to resolve your problem?
BTW, lexeme can have more that one position...
--
Alexander Rueegg
Email: ar*****@uni-bielefeld.de
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives? http://archives.postgresql.org
Alexander,
we'd be glad to add such function to tsearch2 in case it'd be useful
for many peoples, not just you.
Oleg
On Thu, 14 Aug 2003, Teodor Sigaev wrote:
Alexander Rüegg wrote: Thank you for your response. We want to know the distance or sequence of words in a set of text-entries. So first we try to retrieve the text-entries in which the words appear using tsearch indexing. After that we want to calculate the positions of the words in each entry, e.g. parsing the index column of the retrieved text-entries. Maybe there exists a function or an easier/cheaper way to get this information (and which considers that the words maybe occur more than once).
No, it is not exists. The easiest way is to extract this info from tsvector value.
thanks, Alex
Teodor Sigaev wrote:
Alexander Rüegg wrote:
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'
Our query is SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery ; ^^^^^^^^ The result should be something like: 'TSearch2 is very cool', 4 'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a single entry?
You can write such function, but why do you need it? May be there is more simple way to resolve your problem?
BTW, lexeme can have more that one position...
Regards,
Oleg
_______________ _______________ _______________ _______________ _
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: ol**@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Alexander Rüegg wrote: Thank you for your response. We want to know the distance or sequence of words in a set of text-entries. So first we try to retrieve the text-entries in which the words appear using tsearch indexing. After that we want to calculate the positions of the words in each entry, e.g. parsing the index column of the retrieved text-entries. Maybe there exists a function or an easier/cheaper way to get this information (and which considers that the words maybe occur more than once).
No, it is not exists. The easiest way is to extract this info from tsvector value. thanks, Alex
Teodor Sigaev wrote:
Alexander Rüegg wrote:
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'
Our query is SELECT text, position FROM thetable WHERE text_idx @@ 'cool'::tsquery ; ^^^^^^^^ The result should be something like: 'TSearch2 is very cool', 4 'It would be much cooler with lexeme positions', 5
If not, is there a function that returns the positions of a lexeme in a single entry?
You can write such function, but why do you need it? May be there is more simple way to resolve your problem?
BTW, lexeme can have more that one position...
--
Teodor Sigaev E-mail: te****@sigaev.r u
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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 output:
|
by: mailinglists |
last post by:
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
|
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 problem with my configuration?
tsearch2=# select * from ts_debug('jmenuji se Pavel Stìhule a bydlím ve
Skalici.');
|
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?
| |
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...
|
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...
|
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/
|
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
|
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,...
|
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...
| |
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |