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 infinitives: This is actually

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 sam

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

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 and test. -- Robert Haas E

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 pos

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 p

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 mo

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 #

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

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