Re: [HACKERS] Phrase search distance syntax

2016-09-23 Thread Tom Lane
Teodor Sigaev writes: >> Why does the phrase distance operator assume <1> means adjacent words, >> and not <0>. (FYI, <-> is the same as <1>.) > Because > 1 it is a result of subtruction of word's positions > 2 <0> could be used as special case like a word with two

Re: [HACKERS] Phrase search distance syntax

2016-09-23 Thread Bruce Momjian
On Fri, Sep 23, 2016 at 05:07:26PM +0300, Teodor Sigaev wrote: > >Sorry to be asking another phrase search syntax question, and so close > >to final release, but ... > Really close... > > > >Why does the phrase distance operator assume <1> means adjacent words, > >and not <0>. (FYI, <-> is the

Re: [HACKERS] Phrase search distance syntax

2016-09-23 Thread Teodor Sigaev
Sorry to be asking another phrase search syntax question, and so close to final release, but ... Really close... Why does the phrase distance operator assume <1> means adjacent words, and not <0>. (FYI, <-> is the same as <1>.) Because 1 it is a result of subtruction of word's positions 2

[HACKERS] Phrase search distance syntax

2016-09-23 Thread Bruce Momjian
Sorry to be asking another phrase search syntax question, and so close to final release, but ... Why does the phrase distance operator assume <1> means adjacent words, and not <0>. (FYI, <-> is the same as <1>.) For example: select to_tsvector('park a a house') @@ to_tsquery('park <3>

Re: [HACKERS] phrase search TS_phrase_execute code readability patch

2016-08-10 Thread Robert Haas
On Tue, Aug 9, 2016 at 3:35 PM, David G. Johnston wrote: > I don't follow why LposStart is needed so I removed it... That doesn't seem very reasonable. > Not compiled or in any way tested... Please do not bother submitting patches that you aren't prepared to compile

[HACKERS] phrase search TS_phrase_execute code readability patch

2016-08-09 Thread David G. Johnston
Hackers, The attached attempts to make comprehension of the code in "TS_phrase_execute" a bit easier. I posted similar on the "typo patch" thread of July 2nd/5th but my comments there reflected my mis-understanding of the distance operator being exact as opposed to the expected

[HACKERS] phrase search

2010-09-14 Thread Florent Guillaume
Hi, I saw the slides at: http://www.sai.msu.su/~megera/postgres/talks/2009.pdf describing the phrase search algebra for the proposed tsquery $ operator, and the wiki at: http://www.sai.msu.su/~megera/wiki/2009-08-12 Has there been progress on this front? Has the patch phrase_search-0.7.gz

Re: [HACKERS] phrase search

2008-07-22 Thread Teodor Sigaev
1. What is the meaning of such a query operator? foo #5 bar - true if the document has word foo followed by bar at 5th position. foo #5 bar - true if document has word foo followed by bar with in 5 positions foo #5 bar - true if document has word foo followed by bar after 5 positions Sounds

Re: [HACKERS] phrase search

2008-07-19 Thread Oleg Bartunov
Sushant, the problem of phrase search not in implementation, but in the theoretical basis. tsearch is query rich and phrase search should support all query operations, so we need algebra for query operations. We need more time to investigate this problem, but just have no spare time for this. If

Re: [HACKERS] phrase search

2008-07-18 Thread Sushant Sinha
I looked at query operators for tsquery and here are some of the new query operators for position based queries. I am just proposing some changes and the questions I have. 1. What is the meaning of such a query operator? foo #5 bar - true if the document has word foo followed by bar at 5th

Re: [HACKERS] phrase search

2008-06-05 Thread Teodor Sigaev
I can add index support and support for arbitrary distance between lexeme. It appears to me that supporting arbitrary boolean expression will be complicated. Can we pull out something from TSQuery? I don't very like an idea to have separated interface for phrase search. Your patch may be a

Re: [HACKERS] phrase search

2008-06-03 Thread Teodor Sigaev
This is far more complicated than I thought. Of course, phrase search should be able to use indexes. I can probably look into how to use index. Any pointers on this? src/backend/utils/adt/tsginidx.c, if you invent operation # in tsquery then you will have index support with minimal effort.

Re: [HACKERS] phrase search

2008-06-03 Thread Sushant Sinha
On Tue, 2008-06-03 at 22:16 +0400, Teodor Sigaev wrote: This is far more complicated than I thought. Of course, phrase search should be able to use indexes. I can probably look into how to use index. Any pointers on this? src/backend/utils/adt/tsginidx.c, if you invent operation # in

Re: [HACKERS] phrase search

2008-06-02 Thread Teodor Sigaev
I have attached a patch for phrase search with respect to the cvs head. Basically it takes a a phrase (text) and a TSVector. It checks if the relative positions of lexeme in the phrase are same as in their positions in TSVector. Ideally, phrase search should be implemented as new operator in

Re: [HACKERS] phrase search

2008-06-02 Thread Sushant Sinha
On Mon, 2008-06-02 at 19:39 +0400, Teodor Sigaev wrote: I have attached a patch for phrase search with respect to the cvs head. Basically it takes a a phrase (text) and a TSVector. It checks if the relative positions of lexeme in the phrase are same as in their positions in TSVector.

[HACKERS] phrase search

2008-05-31 Thread Sushant Sinha
I have attached a patch for phrase search with respect to the cvs head. Basically it takes a a phrase (text) and a TSVector. It checks if the relative positions of lexeme in the phrase are same as in their positions in TSVector. If the configuration for text search is simple, then this will