You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "alex.wang" <wa...@sohu.com> on 2012/06/19 12:24:31 UTC

question about DIH

hi all:
    when i import the data from db to solr. and solr changed the value with
timezone. 
  eg, the original value is 16/02/2012 12:05:16 , changed to 1/02/2012
04:05:06
. and i add the 8 hours in my sql . it's be correct.
  but when i use delta-import mode to add index. it's not working. 
the sql in config as follow:
  <entity name="sharing" pk="id"
            query="select t.id, t.content , t.money , t.tradeTgtId , t0.name
, DATE_ADD(t.time,INTERVAL 8 HOUR) as time from sharing t LEFT JOIN tradetgt
t0 on t.tradeTgtId = t0.id "
            deltaImportQuery="select t.id, t.content , t.money ,
t.tradeTgtId , t0.name , t.time from sharing t LEFT JOIN tradetgt t0 on
t.tradeTgtId = t0.id where t.id = '${dataimporter.delta.id}'" >
            deltaQuery="select id from sharing where DATE_ADD(time,INTERVAL
8 HOUR) > '${dataimporter.last_index_time}'" >
            <field column="id" name="id"/>
       			<field column="content" name="sharing_content"/>
       			<field column="time" name="sharing_time"/>
						<field column="money" name="sharing_money"/>
						<field column="name" name="trade_name"/>
    </entity>

and no log error. 
i don't know why?

--
View this message in context: http://lucene.472066.n3.nabble.com/question-about-DIH-tp3990261.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: question about DIH

Posted by "alex.wang" <wa...@sohu.com>.
it's still not work in delta-import mode.
and the result as follow:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">15</int>
</lst>
<lst name="initArgs">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</lst>
<str name="command">delta-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages">
<str name="Total Requests made to DataSource">0</str>
<str name="Total Rows Fetched">0</str>
<str name="Total Documents Skipped">0</str>
<str name="Delta Dump started">2012-06-20 10:48:16</str>
<str name="Identifying Delta">2012-06-20 10:48:16</str>
<str name="Deltas Obtained">2012-06-20 10:48:17</str>
<str name="Building documents">2012-06-20 10:48:17</str>
<str name="Total Changed Documents">0</str>
<str name="Total Documents Processed">0</str>
<str name="Time taken">0:0:0.62</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>



--
View this message in context: http://lucene.472066.n3.nabble.com/question-about-DIH-tp3990261p3990454.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: question about DIH

Posted by Erick Erickson <er...@gmail.com>.
Solr indexes all times as UTC (that's what the "Z' is all about). You ought
to be able to get your SQL to return UTC time rather than local, and that
should fix things up for you.

Best
Erick

On Tue, Jun 19, 2012 at 6:24 AM, alex.wang <wa...@sohu.com> wrote:
> hi all:
>    when i import the data from db to solr. and solr changed the value with
> timezone.
>  eg, the original value is 16/02/2012 12:05:16 , changed to 1/02/2012
> 04:05:06
> . and i add the 8 hours in my sql . it's be correct.
>  but when i use delta-import mode to add index. it's not working.
> the sql in config as follow:
>  <entity name="sharing" pk="id"
>            query="select t.id, t.content , t.money , t.tradeTgtId , t0.name
> , DATE_ADD(t.time,INTERVAL 8 HOUR) as time from sharing t LEFT JOIN tradetgt
> t0 on t.tradeTgtId = t0.id "
>            deltaImportQuery="select t.id, t.content , t.money ,
> t.tradeTgtId , t0.name , t.time from sharing t LEFT JOIN tradetgt t0 on
> t.tradeTgtId = t0.id where t.id = '${dataimporter.delta.id}'" >
>            deltaQuery="select id from sharing where DATE_ADD(time,INTERVAL
> 8 HOUR) > '${dataimporter.last_index_time}'" >
>            <field column="id" name="id"/>
>                        <field column="content" name="sharing_content"/>
>                        <field column="time" name="sharing_time"/>
>                                                <field column="money" name="sharing_money"/>
>                                                <field column="name" name="trade_name"/>
>    </entity>
>
> and no log error.
> i don't know why?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/question-about-DIH-tp3990261.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: question about DIH

Posted by wangjing <pp...@gmail.com>.
数据库的表有timestamp字段? 每次 进行更新和修改的时候,这个字段的值都会自动变化,做增量的时候就能根据这个处理了

On Tue, Jun 19, 2012 at 6:24 PM, alex.wang <wa...@sohu.com> wrote:
> hi all:
>    when i import the data from db to solr. and solr changed the value with
> timezone.
>  eg, the original value is 16/02/2012 12:05:16 , changed to 1/02/2012
> 04:05:06
> . and i add the 8 hours in my sql . it's be correct.
>  but when i use delta-import mode to add index. it's not working.
> the sql in config as follow:
>  <entity name="sharing" pk="id"
>            query="select t.id, t.content , t.money , t.tradeTgtId , t0.name
> , DATE_ADD(t.time,INTERVAL 8 HOUR) as time from sharing t LEFT JOIN tradetgt
> t0 on t.tradeTgtId = t0.id "
>            deltaImportQuery="select t.id, t.content , t.money ,
> t.tradeTgtId , t0.name , t.time from sharing t LEFT JOIN tradetgt t0 on
> t.tradeTgtId = t0.id where t.id = '${dataimporter.delta.id}'" >
>            deltaQuery="select id from sharing where DATE_ADD(time,INTERVAL
> 8 HOUR) > '${dataimporter.last_index_time}'" >
>            <field column="id" name="id"/>
>                        <field column="content" name="sharing_content"/>
>                        <field column="time" name="sharing_time"/>
>                                                <field column="money" name="sharing_money"/>
>                                                <field column="name" name="trade_name"/>
>    </entity>
>
> and no log error.
> i don't know why?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/question-about-DIH-tp3990261.html
> Sent from the Solr - User mailing list archive at Nabble.com.