Full Text Search : Parse date

Started by Mickaël DA ROCHAabout 16 years ago3 messagesgeneral
Jump to latest
#1Mickaël DA ROCHA
MICKAEL@documentnumerique.fr

Hello,

We have a document that contains a date (french date for example) : 28-04-2009 (28 April 2009)

In the to_tsvector function, it is noted as :
'-04':2 '-2009':3 '28':1

Is it possible to have something like that (a date) :
'28-04-2009':1

Does a Parser Token Type for date exists ? (« DD-MM-YYYY », « DD-MM-YY », « YYYY-MM-DD », « YY-MM-DD », with « - » or « / »)
(we haven't found it)

Is there another solution ? Any clue ?

Thank You

#2Oleg Bartunov
oleg@sai.msu.su
In reply to: Mickaël DA ROCHA (#1)
Re: Full Text Search : Parse date

On Tue, 11 May 2010, Micka?l DA ROCHA wrote:

Hello,

We have a document that contains a date (french date for example) : 28-04-2009 (28 April 2009)

In the to_tsvector function, it is noted as :
'-04':2 '-2009':3 '28':1

Is it possible to have something like that (a date) :
'28-04-2009':1

Does a Parser Token Type for date exists ? (? DD-MM-YYYY ?, ? DD-MM-YY ?, ? YYYY-MM-DD ?, ? YY-MM-DD ?, with ? - ? or ? / ?)
(we haven't found it)

Is there another solution ? Any clue ?

you can write your own function to transform date to the format of tsearch parser.

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

#3Craig Ringer
craig@2ndquadrant.com
In reply to: Mickaël DA ROCHA (#1)
Re: Full Text Search : Parse date

On 11/05/10 21:19, Micka�l DA ROCHA wrote:

Hello,

We have a document that contains a date (french date for example) :
28-04-2009 (28 April 2009)

In the to_tsvector function, it is noted as :

�-04�:2 �-2009�:3 �28�:1

Is it possible to have something like that (a date) :

�28-04-2009�:1

You'll probably *also* want to continue to output the current year,
month and day (though probably without hyphens), so people can still
search for (eg) "2009".

--
Craig Ringer