Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4aH4-0000fa-Rv for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Feb 2020 01:05:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j4aH3-0007i7-3B for pgsql-bugs@arkaria.postgresql.org; Thu, 20 Feb 2020 01:05:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j4aH2-0007i0-On for pgsql-bugs@lists.postgresql.org; Thu, 20 Feb 2020 01:05:04 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j4aGy-0003Ro-9K for pgsql-bugs@lists.postgresql.org; Thu, 20 Feb 2020 01:05:02 +0000 Received: by mail-pf1-x433.google.com with SMTP id 4so1006156pfz.9 for ; Wed, 19 Feb 2020 17:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=v24ZDT1sFAdShcAv/Zi4S0cvin6FH03+kSLOVZR5G8E=; b=nHc2MlSkFkwWkYlMX5bMYifq8iIggFthR/GOLkTJv40X3EYk6FDZUDTc8Fgbj1rrLH xtdAkI/9JmMNzPXwdcDj41Z0ukKAuMXgpTjLqCItg+KQTMxn4G52hiGozDUH5Vh9+JwJ VZODSD5PtiPflBxiw2JgkQj9DDJxE18Hcis9s0GgHGPTz7rJIk3cQu6RhN9pp2Q6l65l Qskpuj2k9QKGhm+L+vcGSaGljl2J6Lmotl3cPXGoi/CfScMlbTed4J24ZcFbzk7xhEKz Dexp8IvTyQ3U4Y0n4evMYmAF/BY9ZU4A8DtG0r8yHfSeoXRo4gLRl9uxmXDXKdaVlK/k BEUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=v24ZDT1sFAdShcAv/Zi4S0cvin6FH03+kSLOVZR5G8E=; b=M2DCYoijxqzAEGrnrjRMtWI2LQ/0VhGLBqr6wWH8mGWQ1ZtZPo/i2NV4gKDNTMH1Hg CDmSGZkzrsa3VGvLdbBEp+ERG+4KnBGgI1D7Az3M16zwX45Fm3FM5dFTA2g7Dhc3zWLY gxTxpOhMgT4VjO2zhNC3TTIpsMfDXIC4YqjN8shsnvNxwvW6sFEJdDE/UPcCQXjhkmSf +6OvncW6gU3jqRU7mW8Oi0FITqPKN0ur+Zs0YlvcDLdUojCNPl5jFcVmVAdmMdR9DvXj 9Or/ap+I0HXGRRqvoJ+gB/QcK9Q/TXfzZt+TrS5ENrfuovfiqroGL2CxZSyQkPGQj4Pr G3Rw== X-Gm-Message-State: APjAAAW38kQd/xnLnKQavHr8qG/SMOv77Vpt5mnA69DhCxVVwsnHvX9f Oj/3TgUMQ6fBdiz0niAUK/jBf4rhG1E= X-Google-Smtp-Source: APXvYqyYmndP8x4KbGcTfNA7SvdXE08bNIFfIdOpCdmuq7Q3emgNblPRhwSmF0aRPoG++oIHMyPTwA== X-Received: by 2002:a63:3084:: with SMTP id w126mr29975564pgw.169.1582160697786; Wed, 19 Feb 2020 17:04:57 -0800 (PST) Received: from [192.168.2.111] (113x32x180x194.ap113.ftth.ucom.ne.jp. [113.32.180.194]) by smtp.gmail.com with ESMTPSA id b27sm877264pgl.77.2020.02.19.17.04.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Feb 2020 17:04:56 -0800 (PST) Subject: Re: Full text search bug ('russian' regconfig) To: egocenter , pgsql-bugs@lists.postgresql.org References: <1453547361.20200219113508@yandex.ru> From: Artur Zakirov Message-ID: <0f991eaf-2394-41a2-9d8e-c36aef35fbb1@gmail.com> Date: Thu, 20 Feb 2020 10:04:54 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1453547361.20200219113508@yandex.ru> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello On 2/19/2020 5:35 PM, egocenter wrote: > Text search doesn't work correct with the EQUAL string in text and query (russian dictionary config), > as you can see in example ts_vector receives different from ts_query lexemes for identical text: > > tsv = 'дан':1 'магазин':2 'нужн':3 'посеща':4 'точн':5 > tsq = 'нужн' & 'точн' & 'дан' & 'посещаем' & 'магазин' It is because you call to_tsvector() two times. 'russian' is a Snowball dictionary and it uses stemming algorithms to cut words ending. Your query works if to_tsvector() isn't called twice on the same text: =# SELECT web_query_and @@ ts_title, web_query_and @@ 'зачем нужны точные данные о посещаемости магазинов', * FROM (SELECT to_tsvector('russian', 'зачем нужны точные данные о посещаемости магазинов') AS ts_title, websearch_to_tsquery('russian', 'зачем нужны точные данные о посещаемости магазинов?') AS web_query_and ) AS main; It gives 'true' for the first column. -- Artur