Solr DataImportHandler无法使用postgresql添加/更新

时间:2015-02-16 06:44:34

标签: postgresql solr dataimporthandler

我正在尝试使用DataImportHandler索引solr中的postgresql表,但它似乎没有索引

Dataimport结果:

{
  "responseHeader": {
    "status": 0,
    "QTime": 45
  },
  "initArgs": [
    "defaults",
    [
      "config",
      "db-data-config.xml"
    ]
  ],
  "command": "full-import",
  "mode": "debug",
  "documents": [],
  "verbose-output": [],
  "status": "idle",
  "importResponse": "",
  "statusMessages": {
    "Total Requests made to DataSource": "1",
    "Total Rows Fetched": "10",
    "Total Documents Skipped": "0",
    "Full Dump Started": "2015-02-15 20:54:55",
    "": "Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.",
    "Committed": "2015-02-15 20:54:55",
    "Total Documents Processed": "0",
    "Time taken": "0:0:0.37"
  },
  "WARNING": "This response format is experimental.  It is likely to change in the future."
}

db-data-config.xml:

<document>
    <entity name="baby" query="SELECT NAME_ID, BORN_YEAR, FISRT_NAME, BORN_COUNTRY, BABY_SEX, NAME_COUNT from SAMPLE_BABY_NAMES">
        <field column="NAME_ID" name="id"/>
        <field column="FISRT_NAME" name="name"/>
        <field column="BORN_YEAR" name="born"/>
        <field column="BORN_COUNTRY" name="country"/>
        <field column="BABY_SEX" name="sex"/>
        <field column="NAME_COUNT" name="count"/>
    </entity>
</document>

schema.xml filds:

<fields>

    <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
    <field name="sku" type="textTight" indexed="true" stored="true" omitNorms="true"/>
    <field name="name" type="text" indexed="true" stored="true"/>
    <field name="nameSort" type="string" indexed="true" stored="false"/>
    <field name="alphaNameSort" type="alphaOnlySort" indexed="true" stored="false"/>
    <field name="manu" type="text" indexed="true" stored="true" omitNorms="true"/>
    <field name="cat" type="text_ws" indexed="true" stored="true" multiValued="true" omitNorms="true" termVectors="true"/>
    <field name="features" type="text" indexed="true" stored="true" multiValued="true"/>
    <field name="includes" type="text" indexed="true" stored="true"/>
    <field name="weight" type="sfloat" indexed="true" stored="true"/>
    <field name="price" type="sfloat" indexed="true" stored="true"/>
    <field name="popularity" type="sint" indexed="true" stored="true" default="0"/>
    <field name="inStock" type="boolean" indexed="true" stored="true"/>

    <field name="word" type="string" indexed="true" stored="true"/>

    <field name="text" type="text" indexed="true" stored="false" multiValued="true"/>

    <field name="manu_exact" type="string" indexed="true" stored="false"/>
    <field name="_version_" type="long" indexed="true" stored="true"/>
    <field name="born" type="text" indexed="true" stored="true"/>
    <field name="country" type="text" indexed="true" stored="true"/>
    <field name="sex" type="text" indexed="true" stored="true"/>
    <field name="count" type="text" indexed="true" stored="true"/>

    <dynamicField name="*_i" type="sint" indexed="true" stored="true"/>
    <dynamicField name="*_s" type="string" indexed="true" stored="true"/>
    <dynamicField name="*_l" type="slong" indexed="true" stored="true"/>
    <dynamicField name="*_t" type="text" indexed="true" stored="true"/>
    <dynamicField name="*_b" type="boolean" indexed="true" stored="true"/>
    <dynamicField name="*_f" type="sfloat" indexed="true" stored="true"/>
    <dynamicField name="*_d" type="sdouble" indexed="true" stored="true"/>
    <dynamicField name="*_dt" type="date" indexed="true" stored="true"/>
    <dynamicField name="random*" type="random"/>

</fields>

我正在使用solr4.5.0和tomcat7以及postgresql 9.4

0 个答案:

没有答案