Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDxZH-0000q7-UH for pgsql-general@arkaria.postgresql.org; Sun, 12 Nov 2017 19:05:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eDxZH-00026V-Ge for pgsql-general@arkaria.postgresql.org; Sun, 12 Nov 2017 19:05:19 +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_2) (envelope-from ) id 1eBnJ5-0007Fp-UY for pgsql-general@postgresql.org; Mon, 06 Nov 2017 19:43:40 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eBnJ2-0005TP-QS for pgsql-general@postgresql.org; Mon, 06 Nov 2017 19:43:39 +0000 Received: by mail-wm0-x22a.google.com with SMTP id y83so16488650wmc.4 for ; Mon, 06 Nov 2017 11:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MvxAW2x/41RZi46coykCCx18EUkwgDswWyDyTXV035w=; b=Q07aYGpuRrqgUfU7NQO1709XayZebaqgo0eHY67vbPr70FlBZqvTVQo+lEYMgB0lgB GKh7IiMi0J3Cn3SxwO12P0pV+3FoPvFj4813PBzOspa+F6XWIXt1ZX0sX+tBQ8XUAylR kmTqvkeu01zsv1uiVGLW30QNLrIHewI9WpY2xH3BPIal99x9JQm/rnVEpjeSMuVjmmxt cB1/7yDICYTjiWg6MeRpiZDM1se74sRApg/BO+qA2CCAh+ZN/j7+eP0TUw6pVQTNQnzl ITY4MArKaDTABISaFnUApS/7UHnRGx+63Abtg+wi8my7cyWj1k7u6GkFb9dAdNtyElNC h97A== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MvxAW2x/41RZi46coykCCx18EUkwgDswWyDyTXV035w=; b=We6LCSNXjfTlVGQjnK5KBBKspQBXjWcMfDdLibvIRGnN/YYYGzpv7bic2+KR9dQ/uA ZOywa2OGpRqIwR6t/t3t1sZaOVt9IeMYQpmOKDVMY5m+5M9tHtkZDN1WKwwlZsZLzzaZ XYz7t91mbqhE14zKbbS8DxecVVXH9+y3LHavpWKeCY5GnslPo7hp6huMzHOqKvThfLLr sCslwy/AZvoJYWDXZRjL0THPNjcsPs6IhoJGAch1gViSoWZwr/TEKD0OC5e+kjEC8cxs YsP+eX1oqkk8CuLwXO5gOG/w6QuQpGuNksmN8vEshIY0PYEScv0weRlLAFdD5QimPqV7 wJoQ== X-Gm-Message-State: AMCzsaW/cB1tK8rRCsZI/HNoEsZWIysXjYjeqs3Xs5FBQMt1cWIa3tI2 uQQAPdZ4vSdgJN/tS0RA0aI2O+aj X-Google-Smtp-Source: ABhQp+R9DEY14z7OSZCwrY7ZFnTfgoX8J13E5rr6dY0zbkG9wU7NA6KP/cY3QMrmYmxxbGqLou9kQg== X-Received: by 10.80.245.21 with SMTP id t21mr21823549edm.169.1509997415147; Mon, 06 Nov 2017 11:43:35 -0800 (PST) Received: from ?IPv6:2a02:200:2e00:a230:14f1:845b:f2f4:17af? ([2a02:200:2e00:a230:14f1:845b:f2f4:17af]) by smtp.gmail.com with ESMTPSA id f46sm12162378edd.80.2017.11.06.11.43.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 11:43:34 -0800 (PST) Subject: Re: Combine multiple text search configuration To: hmidi slim References: Cc: pgsql-general@postgresql.org From: =?UTF-8?Q?Johannes_Gra=c3=abn?= Message-ID: <034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com> Date: Mon, 6 Nov 2017 20:43:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Hi, On 2017-11-06 09:17, hmidi slim wrote: > Hi, > I want to know if I can combine multiple text search configurations when > I tried to use FTS. > Is there any options like this: > *to_tsvector(['english', 'french'], document)* > * > * > Trying to create a new text configuration: > *Create text search configuration test (copy=simple)* > *Alter text search configuration test* > *add mapping for asciiword with english_stem,french_stem* > * > * > This query doesn't work. How can I combine multiple text search > configurations if I need more than one into my query to search a word? what about using two indexes, one for each language? If your documents can either be English OR French, the English OR the French vector should match an English OR French tsquery. It is not clear to me how combining two stemmers should practically work since each word can only have one stem. If you have multilingual documents or texts with code switching, you could also try combining the two vectors both for the documents and the query: (to_tsvector('english', document) || to_tsvector('french', document)) @@ (to_tsquery('english', query) || to_tsquery('french', query)) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general