Re: [GENERAL] tsearch2: how to plainto_tsquery() with "|"

2014-03-25 Thread John Smith
i thought you shared my frustration :-) (see http://postgresql.1045698.n5.nabble.com/tsearch2-plainto-tsquery-with-OR-td1885955.html). anyway, then "...plainto_tsquery('...')" is pretty much useless when it fails if someone inserts a single boolean operator - back to "...to_tsquery('...')" and inse

Re: [GENERAL] tsearch2: how to plainto_tsquery() with "|"

2014-03-25 Thread Tom Lane
John Smith writes: > i can run "...@@ to_tsquery('cat | dog')". > but if i run "...@@ to_tsquery('cat dog')", it gives me a syntax error > (#42601). > so i run "...@@ plainto_tsquery('cat dog')". > but then i can't run "...@@ plainto_tsquery('cat | dog')". Yeah ... that's pretty much exactly the

Re: [GENERAL] [tsearch2] Problem with case sensitivity (or with creating own dictionary)

2013-08-07 Thread Krzysztof xaru Rajda
Ok, so to be sure if I understand everything - first I should install a postgresql-contrib extension. Next, there will appear a contrib/dict_int directory with dict_int sourcecode inside, which I can modify. Then, I'll be able to install this modified dictionary, and it would be working properl

Re: [GENERAL] [tsearch2] Problem with case sensitivity (or with creating own dictionary)

2013-08-05 Thread Oleg Bartunov
Please, take a look on contrib/dict_int and create your own dict_noop. It should be easy. I think you could document it and share with people (wiki.postgresql.org ?), since there were other people interesting in noop dictionary. Also, don't forget to modify your configuration - use ts_debug(), i

Re: [GENERAL] tsearch2 & dictionaries - possible problem

2010-06-03 Thread Oleg Bartunov
Ivan, did you found your misunderstooding ? You forget how dictionaries work. You need to put some dictionary, which recognize anything, like simple, or stemmer dictionary to recognize 'unknown' word. Look into documentation. Oleg On Wed, 2 Jun 2010, Ivan Voras wrote: hello, I think I have a

Re: [GENERAL] tsearch2 gives NOTICE: word is too long

2010-02-22 Thread Albe Laurenz
AI Rumman wrote: > When I am using the query: > > select length(description), > to_tsvector('default',description) as c from crmentity ; > > Getting error: > > NOTICE: word is too long > > Postgresql 8.1. > > Could anyone please tell me why? Because there is a "word" in the "descriptio

Re: [GENERAL] Tsearch2 with Japanese

2009-11-09 Thread Gordon Callan
Ah, I finally found it http://pgfoundry.org/projects/textsearch-ja/ - Original Message - From: "Gordon Callan" To: pgsql-general@postgresql.org Sent: Monday, November 9, 2009 2:36:18 PM GMT -08:00 US/Canada Pacific Subject: [GENERAL] Tsearch2 with Japanese Does anyone know wh

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Kevin Grittner
Oleg Bartunov wrote: > contrib/test_parser - an example parser code. Using that as a template, I seem to be on track to use the regexp.c code to pick out statute cites from the text in my start function, and recognize when I'm positioned on one in my getlexeme (GETTOKEN) function, delegating ev

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> Can I use a different set of dictionaries >> for creating the tsquery than I did for the tsvector? > > Sure, as long as the tokens (normalized words) that they produce > match up for words that you want to have match. Once the tokens > come out, t

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Oleg Bartunov
On Tue, 7 Apr 2009, Kevin Grittner wrote: Oleg Bartunov wrote: of course, you can build tsquery youself, but once your parser can recognize your very own token 'xxx', it'd be much better to have mapping xxx -> dict_xxx, where dict_xxx knows all semantics. I probably just need to have that "A

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Tom Lane
"Kevin Grittner" writes: > Can I use a different set of dictionaries > for creating the tsquery than I did for the tsvector? Sure, as long as the tokens (normalized words) that they produce match up for words that you want to have match. Once the tokens come out, they're just strings as far as

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Kevin Grittner
Oleg Bartunov wrote: > of course, you can build tsquery youself, but once your parser can > recognize your very own token 'xxx', it'd be much better to have > mapping xxx -> dict_xxx, where dict_xxx knows all semantics. I probably just need to have that "Aha!" moment, slap my forehead, and move

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Oleg Bartunov
On Tue, 7 Apr 2009, Kevin Grittner wrote: If the document text contains '341.15(3)' I want to find it with a search string of '341', '341.15', '341.15(3)' but not '341.15(3)(b)', '341.1', or '15'. How do I handle that? Do I have to build my tsquery values myself as text and cast to tsquery, or

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Kevin Grittner
Oleg Bartunov wrote: > contrib/test_parser - an example parser code. Thanks! Sorry I missed that. -Kevin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-07 Thread Oleg Bartunov
Kevin, contrib/test_parser - an example parser code. On Mon, 6 Apr 2009, Kevin Grittner wrote: Tom Lane wrote: "Kevin Grittner" writes: People are likely to search for statute cites, which tend to have a hierarchical form. I think what you need is a custom parser I've just returned to

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > regexp substitution I found a way to at least keep the cite in one piece. Perhaps I can do the rest in custom dictionaries, which are more pluggable. select ts_debug ('State Statute pertaining to'); ts_debug -

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > Perhaps you could pass the texts and the queries through a regexp > substitution that converts digit-dot-digit to digit-dash-digit? This doesn't seem to get me anywhere. For cite '9.125.07(4A)(3)' I got this: select ts_debug('9-125-07-4A-3'); ts_

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-04-06 Thread Kevin Grittner
Tom Lane wrote: > "Kevin Grittner" writes: >> People are likely to search for statute cites, which tend to have a >> hierarchical form. > I think what you need is a custom parser I've just returned to this and after review have become convinced that this is absolutely necessary; once the def

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-03-11 Thread Kevin Grittner
>>> Oleg Bartunov wrote: > On Tue, 10 Mar 2009, Tom Lane wrote: >> "Kevin Grittner" writes: >>> People are likely to search for statute cites, which tend to have a >>> hierarchical form. I'm not sure the prefix approach will work for >>> this. For example, there is a section 939.64 in the stat

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-03-11 Thread Oleg Bartunov
On Tue, 10 Mar 2009, Tom Lane wrote: "Kevin Grittner" writes: People are likely to search for statute cites, which tend to have a hierarchical form. I'm not sure the prefix approach will work for this. For example, there is a section 939.64 in the state statutes dealing with commission of a

Re: [GENERAL] tsearch2 dictionary for statute cites

2009-03-10 Thread Tom Lane
"Kevin Grittner" writes: > People are likely to search for statute cites, which tend to have a > hierarchical form. I'm not sure the prefix approach will work for > this. For example, there is a section 939.64 in the state statutes > dealing with commission of a crime while wearing a bulletproof

Re: [GENERAL] Tsearch2 Trigger Problem: pg_catalog.simple does not exist

2009-02-11 Thread Pavel Stehule
Hello this bug was reported two weeks ago and it is fixed in 8.3.6. regards Pavel Stehule 2009/2/11 Howard Cole : > Hi, > > I am in the process of updating a database from 8.2 to 8.3 and need a little > help with the tsearch2 update. > > Prior to restoring my 8.3 backup, I ran the tsearch2.sql o

Re: [GENERAL] Tsearch2 Trigger Problem: pg_catalog.simple does not exist

2009-02-11 Thread Howard Cole
RTFM! Just read the part about ditching the tsearch2 function. Sincere apologies. Howard. Howard Cole wrote: execute procedure tsearch2('fts','column1','column2'); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgre

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread John DeSoi
On Oct 31, 2008, at 6:30 AM, Jodok Batlogg wrote: nevertheless i still have the problem that words with '/' are beeing interpreted as file paths instead of words. any idea how i could tweak this? The easiest solution I found was to replace '/' with a space before parsing the text. John

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread Oleg Bartunov
Sergio, On Fri, 31 Oct 2008, Ivan Sergio Borgonovo wrote: On Fri, 31 Oct 2008 13:10:20 +0300 (MSK) Oleg Bartunov <[EMAIL PROTECTED]> wrote: Jodok, you got what's you defined. Please, read documentation. In short, word doesn't indexed if it is not recognized by any dictionaried from stack of

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread Oleg Bartunov
On Fri, 31 Oct 2008, Jodok Batlogg wrote: hi oleg, thanks for your quick response, 2008/10/31 Oleg Bartunov <[EMAIL PROTECTED]>: Jodok, you got what's you defined. Please, read documentation. In short, word doesn't indexed if it is not recognized by any dictionaried from stack of dictionarie

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread Ivan Sergio Borgonovo
On Fri, 31 Oct 2008 13:10:20 +0300 (MSK) Oleg Bartunov <[EMAIL PROTECTED]> wrote: > Jodok, > > you got what's you defined. Please, read documentation. > In short, word doesn't indexed if it is not recognized by any > dictionaried from stack of dictionaries. Put stemming dictionary > at the end, w

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread Jodok Batlogg
hi oleg, thanks for your quick response, 2008/10/31 Oleg Bartunov <[EMAIL PROTECTED]>: > Jodok, > > you got what's you defined. Please, read documentation. > In short, word doesn't indexed if it is not recognized by any > dictionaried from stack of dictionaries. Put stemming dictionary at the end

Re: [GENERAL] tsearch2 problem

2008-10-31 Thread Oleg Bartunov
Jodok, you got what's you defined. Please, read documentation. In short, word doesn't indexed if it is not recognized by any dictionaried from stack of dictionaries. Put stemming dictionary at the end, which recognizes everything. Oleg On Fri, 31 Oct 2008, Jodok Batlogg wrote: we're using tsea

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Tom Lane
Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > I missed it. Thanks. Nearly perfect. Now I've to understand what a > {} is. > An array with a null element? an empty array? an array containing ''? Hmm ... it appears that ts_lexize is returning a one-dimensional array of no elements, whereas '{}

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 10:36:20 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > > It would still be nice to be able to directly work with tsvector > > and tsquery so people could exploit the parser, lexer etc... and > > recycle the config. > > > I'd th

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Tom Lane
Ivan Sergio Borgonovo <[EMAIL PROTECTED]> writes: > It would still be nice to be able to directly work with tsvector > and tsquery so people could exploit the parser, lexer etc... and > recycle the config. > I'd thinking something in the line of > for lex in select * from to_tsvector('jsjdjd fdsds

Re: exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 13:20:12 +0200 Ivan Sergio Borgonovo <[EMAIL PROTECTED]> wrote: > On Tue, 21 Oct 2008 10:29:52 +0200 > Ivan Sergio Borgonovo <[EMAIL PROTECTED]> wrote: > > I came across this: > http://grokbase.com/topic/2007/08/07/general-tsearch2-plainto-tsquery-with-or/r92nI5l_k9S4iKcWdCxKs

exposing more parse was: Re: [GENERAL] tsearch2: setting weights on tsquery

2008-10-21 Thread Ivan Sergio Borgonovo
On Tue, 21 Oct 2008 10:29:52 +0200 Ivan Sergio Borgonovo <[EMAIL PROTECTED]> wrote: I came across this: http://grokbase.com/topic/2007/08/07/general-tsearch2-plainto-tsquery-with-or/r92nI5l_k9S4iKcWdCxKs05yFQk And I find it is strictly related to my needs. Working around ts_parse I could get an a

Re: [GENERAL] tsearch2 query

2008-10-02 Thread Oleg Bartunov
On Thu, 2 Oct 2008, Matthew Terenzio wrote: There are less than 20,000 records being searched here, but the query takes several minutes. I know this may not be enough info, but would one suggest I optimize the query or put my attention towards other areas. SELECT id,date,headline as head,head

Re: [GENERAL] tsearch2 Upgrade to 8.3 tsearch2.so errors

2008-10-01 Thread Darragh Gammell
Hi Richard Thanks for your help. I'll try that. Darragh On Wed, Oct 1, 2008 at 6:03 PM, Richard Huxton <[EMAIL PROTECTED]> wrote: > Darragh Gammell wrote: > > I am currently upgrading from 8.1 to 8.3 and am getting errors when > > restoring the dump from 8.1 into 8.3. Like below: > > > I have

Re: [GENERAL] tsearch2 Upgrade to 8.3 tsearch2.so errors

2008-10-01 Thread Richard Huxton
Darragh Gammell wrote: > I am currently upgrading from 8.1 to 8.3 and am getting errors when > restoring the dump from 8.1 into 8.3. Like below: > I have read this is due to the tsearch2 functions being moved into the core > section of postgres and I'll need to do some editing after the dump to >

Re: [GENERAL] TSearch2: find a QUERY that does match a single document

2008-09-13 Thread Dmitry Koterov
> > explain analyze >> select * from test.test_tsq >> where to_tsvector('40x40') @@ q >> > > why do you need tsvector @@ q ? Much better to use tsquery = tsquery > > test=# explain analyze select * from test_tsq where q = > '40x40'::tsque> >

Re: [GENERAL] TSearch2: find a QUERY that does match a single document

2008-09-12 Thread Oleg Bartunov
On Fri, 12 Sep 2008, Dmitry Koterov wrote: Hello. TSearch2 allows to search a table of tsvectors by a single tsquery. I need to solve the reverse problem. *I have a large table of tsquery. I need to find all tsqueries in that table that match a single document tsvector: * CREATE TABLE "test"."

Re: [GENERAL] Tsearch2 Upgrade from 8.2 to 8.3.1 with mediawiki

2008-05-30 Thread Gerhard Wiesinger
Hello! I found the solution: Normal export. Normal upgrade procedure. su - postgres # Upgrade tsearch2 # http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro.html createdb wikidb psql wikidb < /usr/share/pgsql/contrib/tsearch2.sql psql < pg_dumpall.sql postgres Ciao,

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-23 Thread Ivan Zolotukhin
Hello, We definitely came across this issue recently. When new postgres backend is started it uses ~3MB of the memory accordingly to pmap. When one runs within this backend several typical queries that our application generates its consumed memory increases to 5-8MB which is not critical for us. B

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-22 Thread iSteve
Craig Ringer wrote: This is probably a stupid question, but: with PostgreSQL's use of shared memory, is it possible to load dictionaries into a small reserved shm area when the first backend starts, then use the preloaded copy in subsequent backends? That way the postmaster doesn't have to do an

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-18 Thread Craig Ringer
Tom Lane wrote: What I think *is* worth doing is spending some time on making dictionary loading go faster. This is probably a stupid question, but: with PostgreSQL's use of shared memory, is it possible to load dictionaries into a small reserved shm area when the first backend starts, then

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-18 Thread Tom Lane
Teodor Sigaev <[EMAIL PROTECTED]> writes: >> Hmm, good point; I presume "accept the fact that settings change won't >> propagate to other backends until reconnect" would not be acceptable >> behavior, even if documented along with the relevant configuration option? > I suppose so. That was one o

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-18 Thread iSteve
Teodor Sigaev wrote: As for downsides, I only really see two: * Tracking updates of dictionaries - but it's reasonable to believe that new connections get open more often than the dictionary gets updated. Also, this might be easily solved by stat()-ing the dictionary file before starting up s

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-18 Thread Teodor Sigaev
Hmm, good point; I presume "accept the fact that settings change won't propagate to other backends until reconnect" would not be acceptable behavior, even if documented along with the relevant configuration option? I suppose so. That was one of the reasons to move tsearch into core and it wi

Re: [GENERAL] tsearch2 on-demand dictionary loading & using functions in tsearch2

2008-05-18 Thread Teodor Sigaev
* Considering the database is loaded separately for each session, does this also imply that each running backend has a separate dictionary stored in memory? Yes. As for downsides, I only really see two: * Tracking updates of dictionaries - but it's reasonable to believe that new connection

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Tom Lane
Craig Ringer <[EMAIL PROTECTED]> writes: > Is there any chance your contrib package does not match the core > PostgreSQL version or is from a different source? qsort_arg was added in 8.2, so it seems certain he's trying to load an 8.2 tsearch2 into his 8.1 engine. regards,

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Craig Ringer
Corin Schedler wrote: > Hi all, > > I'm having some trouble installing tsearch2 in to my database. I'm > running 8.1.11 on CentOS 5. Where did the packages come from? Where they part of CentOS / RHEL, or are they obtained from somewhere else? Is there any chance your contrib package does not mat

Re: [GENERAL] Tsearch2 Spanish Dictionary

2008-04-21 Thread Alvaro Herrera
Mario Ignacio Rodríguez Cortés wrote: > But in postgresql-8.3.1: > > SELECT to_tsvector('spanish','estadística'); > to_tsvector > - > 'stic':2 > (1 row) It works for me: alvherre=# SELECT to_tsvector('spanish','estadística'); to_tsvector -- 'estadist':1 (1 fila)

Re: [GENERAL] tsearch2 and hyphenated terms

2008-04-11 Thread Reece Hart
On Fri, 2008-04-11 at 22:07 +0400, Oleg Bartunov wrote: > We have the same problem with names in astronomy, so we implemented > dict_regex http://vo.astronet.ru/arxiv/dict_regex.html > Check it out ! Oleg- This gets me a lot closer. Thank you. I have two remaining problems. The first problem

Re: [GENERAL] tsearch2 and hyphenated terms

2008-04-11 Thread Oleg Bartunov
We have the same problem with names in astronomy, so we implemented dict_regex http://vo.astronet.ru/arxiv/dict_regex.html Check it out ! Oleg On Thu, 10 Apr 2008, Reece Hart wrote: I'd like to use tsearch2 to index protein and gene names. Unfortunately, such names are written inconsistently a

Re: [GENERAL] tsearch2 and hyphenated terms

2008-04-11 Thread Tom Lane
Reece Hart <[EMAIL PROTECTED]> writes: > For the purposes of indexing these names, I suspect I'd get the majority > of cases by removing a hyphen when it's followed by 1 or 2 chars from > [a-zA-Z0-9]. Does that require a custom parser? Yeah, looks like it: regression=# select * from ts_debug('MCL

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-20 Thread Martijn van Oosterhout
On Wed, Mar 19, 2008 at 07:55:40PM -0400, Tom Lane wrote: > (that's \303\240 or 0xc3 0xa0). I am thinking that something decided > the \240 was junk and removed it. Hmm, it is coincidently the space character +0x80, which is defined as a non-breaking space in many Latin encodings. Perhaps ctype d

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread patrick
SELECT 'abc'::text || 'def'::text; it's working fine (no need to convert the query ASCII to UTF8 or such i am using pgadmin (1.8.2) to pass the query: show client_encoding = UNICODE. in postgresql.conf i have: client_encoding; Value = UTF8, Current value = UNICODE; i tried to restart postgresql

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Missed the mailing list on the last reply >> patrick wrote: >>> thoses queries are not working, same message: >>> ERROR: invalid byte sequence for encoding "UTF8": 0xc3 >>> >>> what i found is in postgresql.conf if i change: >>> default_text_search_confi

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Richard Huxton
Missed the mailing list on the last reply Richard Huxton wrote: patrick wrote: hi richard, thanks for your help! i found something... but first let me answer your question: UPDATE product SET search_vector = to_tsvector(name); UPDATE product SET search_vector = setweight(to_tsvector(name),

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > The issue is what characters were in your script file. I'm wondering about non-UTF8 characters in the dictionary file(s) used by the text search configuration. Failure to load a configuration file would explain why it only shows up in tsearch-related q

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Richard Huxton
patrick wrote: Can you identify which row(s) are causing this problem? If we have the value that's causing this, someone can reproduce it. i have only 1 row: 46; "the product name"; "the description"; i don't see any specials chars or accents. I think I've reproduced it here, and it's not yo

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Richard Huxton
patrick wrote: SELECT 'abc'::text || 'def'::text; it's working fine (no need to convert the query ASCII to UTF8 or such OK, now try each of these in turn: UPDATE product SET search_vector = to_tsvector(name); UPDATE product SET search_vector = setweight(to_tsvector(name), 'A'); UPDATE product

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread patrick
Can you identify which row(s) are causing this problem? If we have the value that's causing this, someone can reproduce it. i have only 1 row: 46; "the product name"; "the description"; i don't see any specials chars or accents. knowing that some of my clients are french, should i use LATIN9 a

Re: [GENERAL] tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3

2008-03-19 Thread Richard Huxton
patrick wrote: hi, i have an issue with tseach2, i just installed postgresql 8.3.1 on windows using UTF8 server encoding / client encoding and LOCALE Canada / French. UPDATE product SET search_vector = setweight(to_tsvector(name), 'A') || to_tsvector(description); ERROR: invalid byte sequ

Re: [GENERAL] tsearch2 word separators

2008-03-13 Thread Oleg Bartunov
On Thu, 13 Mar 2008, Sushant Sinha wrote: A document may contain date in the traditional format. For example it may contain '11/1/2007'. It will be useful if we can directly search for year in a document. However, the 'default' tsearch2 parser does not break down integers separated by '/'. So I

Re: [GENERAL] TSearch2 Migration Guide from 8.2 to 8.3

2008-02-12 Thread Robert Treat
On Tuesday 12 February 2008 10:26, Tom Lane wrote: > Richard Huxton <[EMAIL PROTECTED]> writes: > > Oliver Weichhold wrote: > >> Is there something like a Migration Guide from 8.2to > >> 8.3 for tsearch2 users? > > > > Hmm - there was a blog posting recently that linked to a load of > > migration s

Re: [GENERAL] TSearch2 Migration Guide from 8.2 to 8.3

2008-02-12 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Oliver Weichhold wrote: >> Is there something like a Migration Guide from 8.2to >> 8.3 for tsearch2 users? > Hmm - there was a blog posting recently that linked to a load of > migration stuff... There's always RTFM: http://www.postgresql.org/docs/8.3/

Re: [GENERAL] TSearch2 Migration Guide from 8.2 to 8.3

2008-02-12 Thread Richard Huxton
Oliver Weichhold wrote: Hi I run a site with several MediaWiki installations all running on PostgreSQL 8.2.5 utilizing TSearch2. Is there something like a Migration Guide from 8.2to 8.3 for tsearch2 users? Hmm - there was a blog posting recently that linked to a load of migration stuff... H

Re: [GENERAL] tsearch2 text::TSVECTOR cast not working for me on Pg 8.1.6

2008-02-11 Thread Tom Lane
"James Reynolds" <[EMAIL PROTECTED]> writes: > I want to convert a TEXT string that I am mangling to TSVECTOR with a cast. > I am using Postgresql 8.1.6 and tsearch2. > According to the documentation this should work although I am getting an > ERROR. > tsearch2 reference on www.sai.msu.su says th

Re: [GENERAL] tsearch2: stop words and stemming separate?

2008-01-26 Thread Oleg Bartunov
On Sat, 26 Jan 2008, Sushant Sinha wrote: I want to remove stop words but do not want to stem the words. Is there an interface in tsearch2 that allows me to do this? Basically I am trying to implement spelling corrections and do not want to correct stop words. Create custom dictionary using

Re: [GENERAL] tsearch2 install on Fedora Core 5 problems

2008-01-13 Thread Tom Lane
"Satch Jones" <[EMAIL PROTECTED]> writes: > Hello - I can't get tsearch2 running in a long-functioning instance of > PostgreSQL 8.1.9 on Fedora Core 5, and could use some help. Rather than trying to compile it yourself, why don't you just install the postgresql-contrib RPM that goes with the postg

Re: [GENERAL] tsearch2 headline options

2008-01-08 Thread Jan Sunavec
Thanks a lot. It helps. On Fri, 04 Jan 2008 16:54:32 +0100, Oleg Bartunov <[EMAIL PROTECTED]> wrote: On Wed, 2 Jan 2008, Jan Sunavec wrote: Hi all I have following problem when I use this select headline('asd asd asd asd asd asd asd asd asd asd asd asd more more more more more more more',

Re: [GENERAL] tsearch2 headline options

2008-01-04 Thread Oleg Bartunov
On Wed, 2 Jan 2008, Jan Sunavec wrote: Hi all I have following problem when I use this select headline('asd asd asd asd asd asd asd asd asd asd asd asd more more more more more more more', to_tsquery('asd'), ''); I got this "asd asd asd asd asd asd asd asd asd asd asd asd more more more"

Re: [GENERAL] tsearch2 best practices

2007-11-23 Thread Stuart Bishop
Ian Barwick wrote: > 2007/11/18, Mag Gam <[EMAIL PROTECTED]>: >> Hi All, >> >> Planning to implement tsearch2 for my websitem and dbschema. I wanted to >> know if there is a "Best practices" guide I should be following. While >> reading about it, I noticed there were lot of 'gotchas' with this, suc

Re: [GENERAL] tsearch2 best practices

2007-11-19 Thread Ian Barwick
2007/11/18, Mag Gam <[EMAIL PROTECTED]>: > Hi All, > > Planning to implement tsearch2 for my websitem and dbschema. I wanted to > know if there is a "Best practices" guide I should be following. While > reading about it, I noticed there were lot of 'gotchas' with this, such as > back-up/restore, Sl

Re: [GENERAL] Tsearch2 Dutch snowball stemmer in PG8.1

2007-10-03 Thread Oleg Bartunov
On Wed, 3 Oct 2007, Alban Hertroys wrote: Alban Hertroys wrote: The only odd thing is that to_tsvector('dutch', 'some dutch text') now returns '|' for stop words... For example: select to_tsvector('nederlands', 'De beste stuurlui staan aan wal'); to_tsvector

Re: [GENERAL] Tsearch2 Dutch snowball stemmer in PG8.1

2007-10-03 Thread Oleg Bartunov
On Wed, 3 Oct 2007, Alban Hertroys wrote: Oleg Bartunov wrote: Alban, the documentation you're refereed on is for upcoming 8.3 release. For 8.1 and 8.2 you need to do all machinery by hand. It's not difficult, for example: Thanks Oleg. I think I managed to do this right, although I had to go

Re: [GENERAL] Tsearch2 Dutch snowball stemmer in PG8.1

2007-10-03 Thread Alban Hertroys
Alban Hertroys wrote: > The only odd thing is that to_tsvector('dutch', 'some dutch text') now > returns '|' for stop words... > > For example: > select to_tsvector('nederlands', 'De beste stuurlui staan aan wal'); > to_tsvector >

Re: [GENERAL] Tsearch2 Dutch snowball stemmer in PG8.1

2007-10-03 Thread Alban Hertroys
Oleg Bartunov wrote: > Alban, > > the documentation you're refereed on is for upcoming 8.3 release. > For 8.1 and 8.2 you need to do all machinery by hand. It's not > difficult, for example: Thanks Oleg. I think I managed to do this right, although I had to google for some of the files (we don't

Re: [GENERAL] Tsearch2 Dutch snowball stemmer in PG8.1

2007-10-03 Thread Oleg Bartunov
Alban, the documentation you're refereed on is for upcoming 8.3 release. For 8.1 and 8.2 you need to do all machinery by hand. It's not difficult, for example: -- sample tsearch2 configuration for search.postgresql.org -- Creates configuration 'pg' - default, should match server's locale !!! -

Re: [GENERAL] Tsearch2 - spanish

2007-09-20 Thread MOLINA BRAVO FELIPE DE JESUS
Hi Thank's Teodor and Marcelo the problem is solved regards -Mensaje original- De: marcelo Cortez [mailto:[EMAIL PROTECTED] Enviado el: jue 20/09/2007 7:13 Para: MOLINA BRAVO FELIPE DE JESUS; Teodor Sigaev CC: PostgreSQL General Asunto: Re: [GENERAL] Tsearch2 - spanish F

Re: [GENERAL] Tsearch2 - spanish

2007-09-20 Thread marcelo Cortez
Felipe --- Felipe de Jesús Molina Bravo <[EMAIL PROTECTED]> escribió: > Hi > > You are rigth, the output of "show lc_ctype;" is C. > > Then I did is: > > prueba1=# show lc_ctype; > lc_ctype > - > es_MX.ISO8859-1 > (1 row) > > and do it > > % initdb -D /YOUR/PATH -

Re: [GENERAL] Tsearch2 - spanish

2007-09-19 Thread Teodor Sigaev
prueba1=# select to_tsvector('espanol','melón perro mordelón'); server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. !> Hmm, can y

Re: [GENERAL] Tsearch2 - spanish

2007-09-18 Thread Felipe de Jesús Molina Bravo
Hi You are rigth, the output of "show lc_ctype;" is C. Then I did is: prueba1=# show lc_ctype; lc_ctype - es_MX.ISO8859-1 (1 row) and do it % initdb -D /YOUR/PATH -E LATIN1 --locale es_ES.ISO8859-1 (how you do say) and "createdb -E iso8859-1 prueba1" and finally ts

Re: [GENERAL] Tsearch2 - spanish

2007-09-18 Thread Teodor Sigaev
prueba=# select to_tsvector('espanol','melón'); ERROR: Affix parse error at 506 line and prueba=# select lexize('sp','melón'); lexize - {melon} (1 row) Looks very strange, can you provide list of dictionaries and configurati

Re: [GENERAL] tsearch2 and parsing host strings

2007-09-14 Thread Oleg Bartunov
On Tue, 11 Sep 2007, Laimonas Simutis wrote: A question related to tsearch2 functionality in postgres: When I run the following query: select to_tsvector('default', 'website.com') I get "'website.com':1". What I need to get back is 'website':1 instead. I can see that the parser correctly de

Re: [GENERAL] tsearch2 anomoly?

2007-09-07 Thread Teodor Sigaev
Usual text hasn't strict syntax rules, so parser tries to recognize most probable token. Something with '.', '-' and alnum characters is often a filename, but filename is very rare finished or started by dot. RC Gobeille wrote: Thanks and I didn't know about ts_debug, so thanks for that also.

Re: [GENERAL] tsearch2 anomoly?

2007-09-06 Thread RC Gobeille
Thanks and I didn't know about ts_debug, so thanks for that also. For the record, I see how to use my own processing function (e.g. dropatsymbol) to get what I need: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch-V2-intro .html However, can you explain the logic behind the pa

Re: [GENERAL] tsearch2 anomoly?

2007-09-06 Thread Oleg Bartunov
This is how default parser works. See output from select * from ts_debug('gallery2-httpd-conf'); and select * from ts_debug('httpd-2.2.3-5.src.rpm'); All token type: select * from token_type(); On Thu, 6 Sep 2007, RC Gobeille wrote: I'm having trouble understanding to_tsvector. (PostreSQ

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-19 Thread Mike Rylander
On 8/9/07, cluster <[EMAIL PROTECTED]> wrote: > Thanks for your response! Let me try to elaborate what I meant with my > original post. > > If R is the set of words in the tsvector for a given table row and S is > the set of keywords to search for (entered by e.g. a website user) I > would like to

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-13 Thread Ron Mayer
Tom Lane wrote: > Oleg Bartunov <[EMAIL PROTECTED]> writes: >> On Wed, 8 Aug 2007, cluster wrote: >>> Does anyone know where I can request an OR-version of plainto_tsquery()? > >> plainto_tsquery expects plain text, use to_tsquery for boolean operators. > > Are either of these definitions really

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-09 Thread cluster
Thanks for your response! Let me try to elaborate what I meant with my original post. If R is the set of words in the tsvector for a given table row and S is the set of keywords to search for (entered by e.g. a website user) I would like to receive all rows for which the intersection between R

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Oleg Bartunov
On Thu, 9 Aug 2007, Tom Lane wrote: Oleg Bartunov <[EMAIL PROTECTED]> writes: On Thu, 9 Aug 2007, Tom Lane wrote: ... behavior that people want is "here's some words, get me a weighted result", and if the weighting improves from time to time that's OK. We need to provide that API too. I thi

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Trevor Talbot
On 8/8/07, Tom Lane <[EMAIL PROTECTED]> wrote: > Oleg Bartunov <[EMAIL PROTECTED]> writes: > > On Wed, 8 Aug 2007, cluster wrote: > >> Does anyone know where I can request an OR-version of plainto_tsquery()? > > > plainto_tsquery expects plain text, use to_tsquery for boolean operators. > > Are eit

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Tom Lane
Oleg Bartunov <[EMAIL PROTECTED]> writes: > On Thu, 9 Aug 2007, Tom Lane wrote: >> ... behavior that people want is "here's some words, get me a weighted >> result", and if the weighting improves from time to time that's OK. >> We need to provide that API too. > I think I understand. It's called n

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Tom Lane
Oleg Bartunov <[EMAIL PROTECTED]> writes: > On Thu, 9 Aug 2007, Tom Lane wrote: >> Are either of these definitions really right? If I type "foo bar baz" >> into Google, for instance, it seems to produce some sort of weighted >> result, neither a strict AND nor a strict OR. Google didn't get where

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Oleg Bartunov
On Thu, 9 Aug 2007, Tom Lane wrote: Oleg Bartunov <[EMAIL PROTECTED]> writes: " neither a strict AND nor a strict OR" is not a good foundation for database text search API. Maybe not, but the Google boys have sure done well without telling anyone what their algorithms are. My feeling is that

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Tom Lane
Oleg Bartunov <[EMAIL PROTECTED]> writes: > " neither a strict AND nor a strict OR" is not a good foundation for > database text search API. Maybe not, but the Google boys have sure done well without telling anyone what their algorithms are. My feeling is that if you use an API that involves exp

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Oleg Bartunov
On Thu, 9 Aug 2007, Tom Lane wrote: Oleg Bartunov <[EMAIL PROTECTED]> writes: On Thu, 9 Aug 2007, Tom Lane wrote: Are either of these definitions really right? If I type "foo bar baz" into Google, for instance, it seems to produce some sort of weighted result, neither a strict AND nor a stric

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Oleg Bartunov
On Thu, 9 Aug 2007, Tom Lane wrote: Oleg Bartunov <[EMAIL PROTECTED]> writes: On Wed, 8 Aug 2007, cluster wrote: Does anyone know where I can request an OR-version of plainto_tsquery()? plainto_tsquery expects plain text, use to_tsquery for boolean operators. Are either of these definitio

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Tom Lane
Oleg Bartunov <[EMAIL PROTECTED]> writes: > On Wed, 8 Aug 2007, cluster wrote: >> Does anyone know where I can request an OR-version of plainto_tsquery()? > plainto_tsquery expects plain text, use to_tsquery for boolean operators. Are either of these definitions really right? If I type "foo bar

Re: [GENERAL] tsearch2: plainto_tsquery() with OR?

2007-08-08 Thread Oleg Bartunov
On Wed, 8 Aug 2007, cluster wrote: Does anyone know where I can request an OR-version of plainto_tsquery()? plainto_tsquery expects plain text, use to_tsquery for boolean operators. I don't understand why it doesn't exist already: In most cases, when using user entered keywords to search f

  1   2   3   4   >