2012-08-24 3 views
1

저는 Solr을 처음 사용했기 때문에 델타 가져 오기가 아무런 이유없이 전체 가져 오기가 제대로 작동하는 이유를 알 수 없습니다. 델타 가져 오기를 실행할 때마다 새로운 문서를 추가하는 것에 대해 언급하지 않은 것과 동일한 응답이 반환됩니다. updated_at 열이 존재하며 해당 행이 편집/추가 될 때마다 timestamp이 올 Y 름을 포함합니다.Solr 델타 가져 오기가 수행하지 않음

델타 가져 오기를 실행하는 데 필요한 것이 누락 되었습니까?

출력의 http://domain.com:8080/solr/dataimport?command=delta-import

<response> 
    <lst name="responseHeader"> 
     <int name="status">0</int> 
     <int name="QTime">104</int> 
    </lst> 
    <lst name="initArgs"> 
     <lst name="defaults"> 
      <str name="config">/usr/local/solr/conf/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">1</str> 
     <str name="Total Rows Fetched">0</str> 
     <str name="Total Documents Skipped">0</str> 
     <str name="Delta Dump started">2012-08-24 01:55:07</str> 
     <str name="Identifying Delta">2012-08-24 01:55:07</str> 
     <str name="Deltas Obtained">2012-08-24 01:55:07</str> 
     <str name="Building documents">2012-08-24 01:55:07</str> 
     <str name="Total Changed Documents">0</str> 
     <str name="Total Documents Processed">0</str> 
     <str name="Time taken">0:0:0.9</str> 
    </lst> 
    <str name="WARNING"> 
     This response format is experimental. It is likely to change in the future. 
    </str> 
</response> 

데이터의 Config.xml

<dataConfig> 

    <dataSource 
     name="mysql" 
     driver="com.mysql.jdbc.Driver" 
     url="jdbc:mysql://localhost/mysite" 
     user="myuser" 
     password="mypassword" /> 

    <document> 
     <entity 
      name="posts" 
      datasource="mysql" 
      query="select id, title, description from posts" 
      deltaQuery="select id from posts where updated_at > '${dataimporter.last_index_time}'" 
      deltaImportQuery="select id, title, description from posts where id='${dataimporter.delta.id}'"> 
     </entity> 
     <field column="id" name="id" indexed="true" stored="true" /> 
     <field column="title" name="title" indexed="true" stored="true" /> 
     <field column="description" name="description" indexed="true" stored="true" /> 
    </document> 

</dataConfig> 
+0

실제로 일부 문서를 반환하는지 확인하기 위해 deltaQuery를 수동으로 실행 해보십시오. conf 디렉토리에있는 dataimport.properties 파일에서'$ {dataimporter.last_index_time} '을 찾을 수 있습니다. –

+0

'dataimport.properties'의'last_index_time'은 실제 시간보다 4 시간 앞선 것 같습니다! 이것은 DIH가 선택한 문서가 왜 없는지를 설명합니다! DIH의 시간을 어떻게 조정할 수 있습니까? – Nyxynyx

+0

저는 이것이 DIH의 문제라고 생각하지 않습니다. DIH의 시간은 시스템의 시간과 같다고 믿기 때문입니다. 시스템의 문제가 아니라고 확신합니까? –

답변

1

엔티티 소자에 의해 필드 요소, 문서의 구조를 변경 둘러싸 시도 기본 키를 추가 엔티티 속성 :

<entity 
    name="posts" 
    pk="id" 
    datasource="mysql" 
    query="select id, title, description from posts" 
    deltaQuery="select id from posts where updated_at > '${dataimporter.last_index_time}'" 
    deltaImportQuery="select id, title, description from posts where id='${dataimporter.delta.id}'"> 
    <field column="id" name="id" indexed="true" stored="true" /> 
    <field column="title" name="title" indexed="true" stored="true" /> 
    <field column="description" name="description" indexed="true" stored="true" />  
</entity> 
관련 문제