Re: new function for tsquery creartion

2019-07-21 Thread Where is Where
Hello everyone, I am wondering if AROUND(N) or is still possible? I found this thread below and the original post https://www.postgresql.org/message-id/fe93ff7e9ad79196486ada79e268%40postgrespro.ru mentioned the proposed feature: 'New operator AROUND(N). It matches if the distance between

Re: new function for tsquery creartion

2018-04-05 Thread Teodor Sigaev
Thanks to everyone, pushed with some editorization: 1) translate russian test to prevent potential problems with encoding 2) fix inconsistency 'or cat' and 'cat or', second example doesn't treat OR as lexeme, but first one does. -- Teodor Sigaev E-mail:

Re: new function for tsquery creartion

2018-04-04 Thread Dmitry Ivanov
I'm not sure about the different result for these queries: SELECT websearch_to_tsquery('simple', 'cat or '); websearch_to_tsquery -- 'cat' (1 row) SELECT websearch_to_tsquery('simple', 'cat or'); websearch_to_tsquery -- 'cat' & 'or' (1 row) I guess

Re: new function for tsquery creartion

2018-04-03 Thread Aleksandr Parfenov
On Tue, 03 Apr 2018 14:28:37 +0300 Dmitry Ivanov wrote: > I'm sorry, I totally forgot to fix a few more things, the patch is > attached below. The patch looks good to me except two things. I'm not sure about the different result for these queries: SELECT

Re: new function for tsquery creartion

2018-04-03 Thread Dmitry Ivanov
The code in its current state looks messy and way too complicated; there're lots of interleaving code branches. Thus, I decided to split gettoken_query() into three independent tokenizers for phrase, web and original (to_tsquery()) syntaxes. Documentation is included. Any feedback is very

Re: new function for tsquery creartion

2018-04-03 Thread Dmitry Ivanov
Hi everyone, The code in its current state looks messy and way too complicated; there're lots of interleaving code branches. Thus, I decided to split gettoken_query() into three independent tokenizers for phrase, web and original (to_tsquery()) syntaxes. Documentation is included. Any

Re: new function for tsquery creartion

2018-04-02 Thread Dmitry Ivanov
I've fixed a bug and added some tests and documentation. -- Dmitry Ivanov Postgres Professional: http://www.postgrespro.com The Russian Postgres Companydiff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 5abb1c46fb..c3b7be6e4e 100644 --- a/doc/src/sgml/func.sgml +++

Re: new function for tsquery creartion

2018-04-01 Thread Dmitry Ivanov
Hi Aleksandr, I agree with Aleksander about silencing all errors in websearch_to_tsquery(). In the attachment is a revised patch with the attempt to introduce an ability to ignore syntax errors in gettoken_tsvector(). Thanks for the further improvements! Yes, you're both right, the API has

Re: new function for tsquery creartion

2018-04-01 Thread Aleksandr Parfenov
Hello hackers, On 2018-03-28 12:21, Aleksander Alekseev wrote: It doesn't sound right to me to accept any input as a general rule but sometimes return errors nevertheless. That API would be complicated for the users. Thus I suggest to accept any garbage and try our best to interpret it. I

Re: new function for tsquery creartion

2018-03-28 Thread Aleksander Alekseev
Hello Dmitry, > A few gotchas: > > I haven't touched gettoken_tsvector() yet. As a result, the following > queries produce errors: > > select websearch_to_tsquery('simple', ); > ERROR: syntax error in tsquery: "'" > > select websearch_to_tsquery('simple', '\'); > ERROR: there is no

Re: new function for tsquery creartion

2018-03-27 Thread Dmitry Ivanov
select websearch_to_tsquery('simple', 'abc or!def'); websearch_to_tsquery -- 'abc' | 'def' (1 row) This is wrong ofc, I've attached the fixed version. -- Dmitry Ivanov Postgres Professional: http://www.postgrespro.com The Russian Postgres Companydiff --git

Re: new function for tsquery creartion

2018-03-27 Thread Dmitry Ivanov
Hi everyone, I'd like to share some intermediate results. Here's what has changed: 1. OR operator is now case-insensitive. Moreover, trailing whitespace is no longer used to identify it: select websearch_to_tsquery('simple', 'abc or'); websearch_to_tsquery -- 'abc' &

Re: new function for tsquery creartion

2018-03-26 Thread Dmitry Ivanov
Patch 03 (the documentation) needed some proof-reading. I've attached a new version of that patch with some small suggested improvements. Thanks, I'm definitely going to use this. Is there anything to_tsquery() can do that websearch_to_tsquery() can't? Currently, no. Would it be OK to

Re: new function for tsquery creartion

2018-03-26 Thread Thomas Munro
On Mon, Mar 26, 2018 at 9:51 PM, Dmitry Ivanov wrote: >> Recently I worked with the old version of the patch and found a bug. >> So, I think it is better to notify you immediately, so you can fix it in >> rebased/revised version. >> >> I noticed, that operator AROUND(N)

Re: new function for tsquery creartion

2018-03-26 Thread Dmitry Ivanov
Recently I worked with the old version of the patch and found a bug. So, I think it is better to notify you immediately, so you can fix it in rebased/revised version. I noticed, that operator AROUND(N) works only in case of non-negative operands. If any of the operands is negative, it

Re: new function for tsquery creartion

2018-03-26 Thread Aleksandr Parfenov
On Thu, 22 Mar 2018 16:53:15 +0300 Dmitry Ivanov wrote: > Hi David, > > I'd like to take over from Victor. I'll post a revised version of the > patch in a couple of days. > Hi Dmitry, Recently I worked with the old version of the patch and found a bug. So, I think

Re: [HACKERS] new function for tsquery creartion

2018-03-22 Thread Teodor Sigaev
I am extending phrase operator is such way that it will have syntax that means from n to m words, so I will use such syntax () further. I found that a AROUND(N) b is exactly the same as a <-N,N> b and it can be replaced while parsing. So, what do you think of such idea? In this

Re: new function for tsquery creartion

2018-03-22 Thread Dmitry Ivanov
Hi David, I'd like to take over from Victor. I'll post a revised version of the patch in a couple of days. -- Dmitry Ivanov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: Re: new function for tsquery creartion

2018-03-21 Thread David Steele
Hi Victor, On 3/5/18 7:52 AM, Aleksander Alekseev wrote: > It seems that this patch doesn't apply anymore, see > http://commitfest.cputube.org/ > > The new status of this patch is: Waiting on Author This patch needs a rebase and should address the comments from Aleksander and Andres. We are

Re: new function for tsquery creartion

2018-03-05 Thread Aleksander Alekseev
It seems that this patch doesn't apply anymore, see http://commitfest.cputube.org/ The new status of this patch is: Waiting on Author

Re: new function for tsquery creartion

2018-03-01 Thread Andres Freund
On 2017-11-29 17:56:30 +0300, Victor Drobny wrote: > Thank you for review. I have tried to fix all of your comments. > However i want to mention that the absence of comments for functions > in to_tsany.c is justified by the absence of comments for other > similar functions. That's not

Re: new function for tsquery creartion

2018-01-15 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Here are a few minor issues: ``` +/* + * Checks if 'str'

Re: new function for tsquery creartion

2017-11-29 Thread Victor Drobny
On 2017-11-29 17:56, Victor Drobny wrote: Sorry, forgot to attach new version of the patch. On 2017-11-28 17:57, Aleksander Alekseev wrote: Hi Aleksander, Thank you for review. I have tried to fix all of your comments. However i want to mention that the absence of comments for functions in

Re: new function for tsquery creartion

2017-11-28 Thread Michael Paquier
On Tue, Nov 28, 2017 at 11:57 PM, Aleksander Alekseev wrote: >> I like the idea and I think it's a great patch. However in current shape it >> requires some amount of reworking to meet PostgreSQL standards of code >> quality. > > Also I would like to add that I agree

Re: new function for tsquery creartion

2017-11-28 Thread Aleksander Alekseev
Hi Victor, > I like the idea and I think it's a great patch. However in current shape it > requires some amount of reworking to meet PostgreSQL standards of code > quality. Also I would like to add that I agree with Thomas Munro: > Calling this search syntax just "query" seems too general and

Re: [HACKERS] new function for tsquery creartion

2017-11-27 Thread Victor Drobny
On 2017-11-19 04:30, Tomas Vondra wrote: Hello, Hi, On 09/13/2017 10:57 AM, Victor Drobny wrote: On 2017-09-09 06:03, Thomas Munro wrote: Please send a rebased version of the patch for people to review and test as that one has bit-rotted. Hello, Thank you for interest. In the attachment you

Re: [HACKERS] new function for tsquery creartion

2017-11-18 Thread Tomas Vondra
Hi, On 09/13/2017 10:57 AM, Victor Drobny wrote: > On 2017-09-09 06:03, Thomas Munro wrote: >> Please send a rebased version of the patch for people to review and >> test as that one has bit-rotted. > Hello, > Thank you for interest. In the attachment you can find rebased > version(based on