Re: Combine multiple text search configuration

From: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
To: Johannes Graën <johannes(at)selfnet(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Combine multiple text search configuration
Date: 2017-11-07 07:27:16
Message-ID: CAMsqVxtuemP+8uu1UxY9jNvoyy2srDatE8BQpAD1WpsgPCcd7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
Thank for your proposition but when to use this query :
(to_tsvector('english', document) || to_tsvector('french', document)) @@
(to_tsquery('english', query) || to_tsquery('french', query))
I think that the performance decrease and not a good solution for big
amount of data. Is it?

2017-11-06 20:46 GMT+01:00 Johannes Graën <johannes(at)selfnet(dot)de>:

> 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))
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Krithika Venkatesh 2017-11-07 07:34:20 Re: Incremental refresh - Materialized view
Previous Message Thomas Kellerer 2017-11-07 07:16:29 Re: idle in transaction, why