pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Johannes Graën <johannes.graen@gmail.com>
To: hmidi slim <hmidi.slim2@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Combine multiple text search configuration
Date: Mon, 6 Nov 2017 20:43:33 +0100
Message-ID: <034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com> (raw)
In-Reply-To: <CAMsqVxsSy444Lj9oTiva6d62cWCWc+cYt-Uj7M6SpgC0KQUKHw@mail.gmail.com>
References: <CAMsqVxsSy444Lj9oTiva6d62cWCWc+cYt-Uj7M6SpgC0KQUKHw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

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



view thread (7+ messages)  latest in thread

Message-ID: <034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com>
Permalink:  ../034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com/
Also on:    postgresql.org/message-id/034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: johannes.graen@gmail.com, hmidi.slim2@gmail.com
  Subject: Re: Combine multiple text search configuration
  In-Reply-To: <034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com>
  References: <CAMsqVxsSy444Lj9oTiva6d62cWCWc+cYt-Uj7M6SpgC0KQUKHw@mail.gmail.com> <034a1475-4e88-227b-8f96-2bc64ce6998e@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox