Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data-config.xml:
- <dataConfig>
- <dataSource type="JdbcDataSource"
- driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://localhost/xxxxx"
- batchSize="-1"
- user="xxxx"
- password="xxxxx"/>
- <document>
- <entity name="name" query="SELECT id, name FROM name LIMIT 10">
- <field column="id" name="nameid" />
- <field column="name" name="name" />
- </entity>
- <entity name="title" query="SELECT id, title FROM title LIMIT 10">
- <field column="id" name="titleid" />
- <field column="title" name="title" />
- </entity>
- </document>
- </dataConfig>
- schema.xml:
- <fields>
- <!-- Valid attributes for fields:
- name: mandatory - the name for the field
- type: mandatory - the name of a previously defined type from the
- <types> section
- indexed: true if this field should be indexed (searchable or sortable)
- stored: true if this field should be retrievable
- multiValued: true if this field may contain multiple values per document
- omitNorms: (expert) set to true to omit the norms associated with
- this field (this disables length normalization and index-time
- boosting for the field, and saves some memory). Only full-text
- fields or fields that need an index-time boost need norms.
- Norms are omitted for primitive (non-analyzed) types by default.
- termVectors: [false] set to true to store the term vector for a
- given field.
- When using MoreLikeThis, fields used for similarity should be
- stored for best performance.
- termPositions: Store position information with the term vector.
- This will increase storage costs.
- termOffsets: Store offset information with the term vector. This
- will increase storage costs.
- default: a value that should be used if no value is specified
- when adding a document.
- -->
- <field name="nameid" type="string" indexed="true" stored="true" />
- <field name="name" type="text_general" indexed="true" stored="true" />
- <field name="titleid" type="string" indexed="true" stored="true" />
- <field name="title" type="text_general" indexed="true" stored="true" />
- <!-- uncomment the following to ignore any fields that don't already match an existing
- field name or dynamic field, rather than reporting them as an error.
- alternately, change the type="ignored" to some other type e.g. "text" if you want
- unknown fields indexed and/or stored by default -->
- <dynamicField name="*" type="ignored" multiValued="true" />
- </fields>
- <uniqueKey>nameid</uniqueKey>
- </schema>
- errormessge in tomcat-log for every entry of second table:
- Jun 06, 2013 9:48:56 AM org.apache.solr.handler.dataimport.SolrWriter upload
- WARNING: Error creating document : SolrInputDocument[{titleid=titleid(1.0)={99353}, title=title(1.0)={Legal Eagle Feathers His Nest}}]
- org.apache.solr.common.SolrException: [doc=null] missing required field: nameid
Advertisement
Add Comment
Please, Sign In to add comment