Re: Storing MYSQL DATETIME field in solr as String

2014-01-23 Thread tariq
Hello manju, Thank you! It's really helpful for me. -- View this message in context: http://lucene.472066.n3.nabble.com/Solved-Storing-MYSQL-DATETIME-field-in-solr-as-String-tp4106836p4112977.html Sent from the Solr - User mailing list archive at Nabble.com.

Re: Storing MYSQL DATETIME field in solr as String

2014-01-23 Thread manju16832003
Hi Tariq, I'm glad that helped you :-). Thanks -- View this message in context: http://lucene.472066.n3.nabble.com/Solved-Storing-MYSQL-DATETIME-field-in-solr-as-String-tp4106836p4112979.html Sent from the Solr - User mailing list archive at Nabble.com.

Re: Storing MYSQL DATETIME field in solr as String

2014-01-06 Thread manju16832003
I found a way to store MySQL DateTime as a string in Solr Here is the way in data-config.xml in the SQL query we could convert the date directly to char CAST(l.creation_date as char) as creation_date, CAST(l.modification_date as char) as modification_date, in schema.xml Output would be 20

Re: Storing MYSQL DATETIME field in solr as String

2013-12-17 Thread manju16832003
Hi Raymond, Let me give a try. Thanks for suggestion :-). Cheers, On Wed, Dec 18, 2013 at 12:38 AM, Raymond Wiker [via Lucene] < ml-node+s472066n410713...@n3.nabble.com> wrote: > > On 17 Dec 2013, at 17:30 , manju16832003 <[hidden > email]

Re: Storing MYSQL DATETIME field in solr as String

2013-12-17 Thread Raymond Wiker
On 17 Dec 2013, at 17:30 , manju16832003 wrote: > Hi Raymond, > You mean during the DIH execution? Yes; as part of the sql statement.

Re: Storing MYSQL DATETIME field in solr as String

2013-12-17 Thread manju16832003
Hi Shekhar, Yes :-). Thanks for the references. Will try out the options you mentioned. Thanks -- View this message in context: http://lucene.472066.n3.nabble.com/Storing-MYSQL-DATETIME-field-in-solr-as-String-tp4106836p4107135.html Sent from the Solr - User mailing list archive at Nabble.co

Re: Storing MYSQL DATETIME field in solr as String

2013-12-17 Thread manju16832003
Hi Raymond, You mean during the DIH execution? -- View this message in context: http://lucene.472066.n3.nabble.com/Storing-MYSQL-DATETIME-field-in-solr-as-String-tp4106836p4107136.html Sent from the Solr - User mailing list archive at Nabble.com.

Re: Storing MYSQL DATETIME field in solr as String

2013-12-16 Thread Raymond Wiker
To me, the obvious way of doing this would be to CAST the DATETIME to CHAR(n), or (probably better) use DATE_FORMAT(). On Tue, Dec 17, 2013 at 5:21 AM, Shalin Shekhar Mangar < shalinman...@gmail.com> wrote: > I'm sorry. I thought you wanted to parse a date stored as string into > a java.util.Dat

Re: Storing MYSQL DATETIME field in solr as String

2013-12-16 Thread Shalin Shekhar Mangar
I'm sorry. I thought you wanted to parse a date stored as string into a java.util.Date. Clearly, you are trying to go the other way round. There's nothing in DIH which will convert a mysql date to a string in specific format. You will need to write a custom transformer either in javascript or in j

Re: Storing MYSQL DATETIME field in solr as String

2013-12-16 Thread manju16832003
OK here are the scenarios I tried. *Scenario - 1: * dih.xml (aka data-config.xml) -MM-dd'T'HH:mm:ss*" locale="en"/> schema.xml It does not work. Throws an following exception WARN org.apache.solr.handler.dataimport.DateFormatTransformer – Could not parse a Date field java.text.ParseE

Re: Storing MYSQL DATETIME field in solr as String

2013-12-15 Thread manju16832003
Hi Shekhar, Yes, I did specify transformer="DateFormatTransformer" in and I did re-index :-(. Bit strange output. Even I tried to change the Data type of the data field in schema.xml as well. I have tried with changing date type from String to Date and Date to String by applying DateFormatTransf

Re: Storing MYSQL DATETIME field in solr as String

2013-12-15 Thread Shalin Shekhar Mangar
On Mon, Dec 16, 2013 at 12:38 PM, manju16832003 wrote: > Hi Shekhar, > Thanks for replying :-). > Yes your answer is justifiable. > DateFormatTransformer was a good consideration. However it doesn't out the > format I expected. Rather it outputs in the following manner > > Tue Jun 05 00:00:00 MYT

Re: Storing MYSQL DATETIME field in solr as String

2013-12-15 Thread manju16832003
Hi Shekhar, Thanks for replying :-). Yes your answer is justifiable. DateFormatTransformer was a good consideration. However it doesn't out the format I expected. Rather it outputs in the following manner Tue Jun 05 00:00:00 MYT 2012 Here is DIH configuration And also I tried this way *-- with

Re: Storing MYSQL DATETIME field in solr as String

2013-12-15 Thread Shalin Shekhar Mangar
This is not a Solr specific problem. The java.sql.Timestamp class which is what you get for a DateTime field contains a nano-second component. This shows up as a .0 when you do a toString() conversion. If you want to show this values to your client in a diffferent or mysql-specific format, you can