Re: [GENERAL] Full text search question: "01.Bez." --> "Erster Bezirk"
Hello, On Sat, Mar 12, 2016 at 11:40 AM, Johann Höchtlwrote: > I fear I have an involved challenge concerning FTS. > > Assume I have the following text in a column: > > Graz,06.Bez.:Blah > > This parses as: > SELECT alias, description, token FROM ts_debug('german', > 'Graz,06.Bez.:Blah'); >alias | description | token > ---+-+ > asciiword | Word, all ASCII | Graz > blank | Space symbols | , > host | Host| 06.Bez > blank | Space symbols | .: > asciiword | Word, all ASCII | Blah > > > Bez. ist the abbreviation for "Bezirk" (german for ~district). 06.Bez > means "6th district" > > My first problem might be that the parser identifies "06.Bez." as a host > lexeme, but ... > > I already defined a synonym dictionary to enable searching for "Bezirk", > when there is only "Bez." in the database: > > file: bevaddress_host.syn: > 01.bez bezirk > 06.bez bezirk > > > > CREATE TEXT SEARCH DICTIONARY bevaddress_host_syn ( > TEMPLATE = synonym, > SYNONYMS = bevaddress_host > ); > ALTER TEXT SEARCH CONFIGURATION german ALTER MAPPING FOR host WITH > bevaddress_host_syn, simple; > > > I wonder how I can achieve to be able to search for "Erster Bezirk" > ("First district") to match eg. "01.Bez." > > Thank you for your help, Johann > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > As of the time of writing this I haven't seen any replies to your post so you may not be aware that an answer was provided to your specific question in a blog. http://obartunov.livejournal.com/185579.html Regards, Dane
[GENERAL] Full text search question: "01.Bez." --> "Erster Bezirk"
I fear I have an involved challenge concerning FTS. Assume I have the following text in a column: Graz,06.Bez.:Blah This parses as: SELECT alias, description, token FROM ts_debug('german', 'Graz,06.Bez.:Blah'); alias | description | token ---+-+ asciiword | Word, all ASCII | Graz blank | Space symbols | , host | Host| 06.Bez blank | Space symbols | .: asciiword | Word, all ASCII | Blah Bez. ist the abbreviation for "Bezirk" (german for ~district). 06.Bez means "6th district" My first problem might be that the parser identifies "06.Bez." as a host lexeme, but ... I already defined a synonym dictionary to enable searching for "Bezirk", when there is only "Bez." in the database: file: bevaddress_host.syn: 01.bez bezirk 06.bez bezirk CREATE TEXT SEARCH DICTIONARY bevaddress_host_syn ( TEMPLATE = synonym, SYNONYMS = bevaddress_host ); ALTER TEXT SEARCH CONFIGURATION german ALTER MAPPING FOR host WITH bevaddress_host_syn, simple; I wonder how I can achieve to be able to search for "Erster Bezirk" ("First district") to match eg. "01.Bez." Thank you for your help, Johann -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Full-Text Search question
Search for fulltext tutorial + json functions http://www.postgresql.org/docs/9.3/static/functions-json.html On Wed, May 14, 2014 at 1:00 AM, Jesus Rafael Sanchez Medrano jesusraf...@gmail.com wrote: thanks... could you please be so kind to post some snippet/code for this? Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up On Tue, May 13, 2014 at 5:33 PM, Oleg Bartunov obartu...@gmail.comwrote: Easy, you need to extract text fields from json and construct tsvector from them (use concatenation, for example). On Tue, May 13, 2014 at 7:38 PM, Jesus Rafael Sanchez Medrano jesusraf...@gmail.com wrote: can postgres do FTS (full text search) on a json column? if possible, please be so kindd to give some snippet/example. Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up
[GENERAL] Full-Text Search question
can postgres do FTS (full text search) on a json column? if possible, please be so kindd to give some snippet/example. Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up
Re: [GENERAL] Full-Text Search question
Easy, you need to extract text fields from json and construct tsvector from them (use concatenation, for example). On Tue, May 13, 2014 at 7:38 PM, Jesus Rafael Sanchez Medrano jesusraf...@gmail.com wrote: can postgres do FTS (full text search) on a json column? if possible, please be so kindd to give some snippet/example. Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Full-Text Search question
thanks... could you please be so kind to post some snippet/code for this? Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up On Tue, May 13, 2014 at 5:33 PM, Oleg Bartunov obartu...@gmail.com wrote: Easy, you need to extract text fields from json and construct tsvector from them (use concatenation, for example). On Tue, May 13, 2014 at 7:38 PM, Jesus Rafael Sanchez Medrano jesusraf...@gmail.com wrote: can postgres do FTS (full text search) on a json column? if possible, please be so kindd to give some snippet/example. Att. == Jesus Rafael Sanchez Medrano Life is a dream, of which all must wake up
[GENERAL] Full text search question (select...match...against).
Hello everybody, We are trying to migrate an application from MySQL to PostgreSQL, and all works fine except for a text based search we must do. In MySQL we can run the next SQL sentence: SELECT *, MATCH a,b AGAINST ('sample text') as x FROM t; and it returns the a and b columns and a x column with a number that means how much the text of the a and b columns meets the 'sample text' text. Example (taken from the MySQL manual): mysql SELECT *,MATCH a,b AGAINST ('collections support') as x FROM t; +--+---++ | a| b | x | +--+---++ | MySQL has now support| for full-text search | 0.3834 | | Full-text indexes| are called collections| 0.3834 | | Only MyISAM tables | support collections | 0.7668 | | Function MATCH ... AGAINST() | is used to do a search| 0 | | Full-text search in MySQL| implements vector space model | 0 | +--+---++ Does anyone know how to do this in PostgreSQL? Thank you in advance for your answer. -- Alberto Otero Garca e-mail: [EMAIL PROTECTED] Cometa Technologies, S.L. URL: http://www.cometatech.com