Thomas Escolan
Thomas Escolan

Reputation: 1529

Solr-MySQL DataImportHandler only retrieves ID instead of SELECT * query

I'm new to SEO and having an issue with Mysql data extraction within Solr 8.8; despite that below declaration, the document is only retrieving ID instead of the whole bunch.

<document>
  <entity name="foobars"
    query="SELECT *, 'test' AS ENTITY FROM foobar"
    deltaquery="SELECT ID FROM foobar WHERE updated >= '${dataimporter.last_index_time}'"
    deltaimportquery="SELECT *, 'MAT' AS ENTITY FROM foobar WHERE ID = ${dataimporter.delta.id}">
    <field column="ENTITY" name="entity" />
    <field column="ID" name="id" />
    <field column="FOO" name="foo" />
    <field column="BAR" name="bar" />
    <field column="BAZ" name="baz" />
    <field column="UPDATED" name="updated" />  
  </entity>
</document>

This is a sample of what was imported :

{
  "responseHeader":{
    "status":0,
    "QTime":9,
    "params":{
      "q":"*:*",
      "_":"1623166185835"}},
  "response":{"numFound":147,"start":0,"numFoundExact":true,"docs":[
      {
        "id":"214768.0",
        "_version_":1702016739810738176},
      {
        "id":"296594.0",
        "_version_":1702016739840098304},
...

Does anyone knows what I'm missing here? Thanks for any help.

Upvotes: 0

Views: 56

Answers (0)

Related Questions