Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zyy3U-0001NB-Ar for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Nov 2015 08:25:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zyy3T-0004sP-TY for pgsql-bugs@arkaria.postgresql.org; Wed, 18 Nov 2015 08:25:27 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zyy2q-00047U-UZ for pgsql-bugs@postgresql.org; Wed, 18 Nov 2015 08:24:48 +0000 Received: from newmail.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Zyy2n-0006E9-Eg for pgsql-bugs@postgresql.org; Wed, 18 Nov 2015 08:24:48 +0000 Received: from [192.168.27.188] (unknown [192.168.27.1]) by mail.postgrespro.ru (Postfix) with ESMTPSA id F08DF21C4589; Wed, 18 Nov 2015 11:24:43 +0300 (MSK) Subject: Re: BUG #13766: weird ts_headline/ts_vector/ts_query behaviour To: aslesha.akella@gmail.com, pgsql-bugs@postgresql.org References: <20151110135342.2567.84095@wrigleys.postgresql.org> From: Artur Zakirov Message-ID: <564C35CB.9020800@postgrespro.ru> Date: Wed, 18 Nov 2015 11:24:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151110135342.2567.84095@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 10.11.2015 16:53, aslesha.akella@gmail.com wrote: > > We are trying to make text search for a word "goede" and "goed". It got the > following results with different languages. > Hi Do you use predefined text search configurations "english" and "dutch"? If so and you do not change them, then "english" and "dutch" configurations use English and Dutch stemming algorithms (https://en.wikipedia.org/wiki/Stemming) and check for stop words. In the following examples you can see how words are converted to lexems: > select to_tsvector('dutch', 'Goede vrijdag'); to_tsvector ---------------------- 'goed':1 'vrijdag':2 (1 row) > select to_tsvector('dutch', 'Goed vrijdag'); to_tsvector ---------------------- 'goed':1 'vrijdag':2 (1 row) > select to_tsvector('english', 'Goed vrijdag'); to_tsvector -------------------- 'go':1 'vrijdag':2 (1 row) > select to_tsvector('english', 'Goede vrijdag'); to_tsvector ---------------------- 'goed':1 'vrijdag':2 (1 row) The simple configuration do not use stemming algorithms. It only convert input words to lower case lexems and exclude stop words. You also can create ispell dictionary and use it. More information in the documentation: http://www.postgresql.org/docs/devel/static/textsearch-dictionaries.html and good articles: http://shisaa.jp/postset/postgresql-full-text-search-part-1.html http://shisaa.jp/postset/postgresql-full-text-search-part-2.html http://shisaa.jp/postset/postgresql-full-text-search-part-3.html But I am not sure that I understood your question correctly. -- Artur Zakirov Postgres Professional: http://www.postgrespro.com Russian Postgres Company -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs