Guest User

Untitled

a guest
Jun 6th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.96 KB | None | 0 0
  1. data-config.xml:
  2.  
  3. <dataConfig>
  4.   <dataSource type="JdbcDataSource"
  5. driver="com.mysql.jdbc.Driver"
  6. url="jdbc:mysql://localhost/xxxxx"
  7. batchSize="-1"
  8. user="xxxx"
  9. password="xxxxx"/>
  10.  
  11.   <document>
  12.     <entity name="name" query="SELECT id, name FROM name LIMIT 10">
  13.         <field column="id" name="nameid" />
  14.         <field column="name" name="name" />
  15.     </entity>    
  16.     <entity name="title" query="SELECT id, title FROM title LIMIT 10">
  17.         <field column="id" name="titleid" />
  18.         <field column="title" name="title" />
  19.     </entity>
  20.   </document>
  21. </dataConfig>
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. schema.xml:
  30.  
  31.  
  32.  <fields>
  33.    <!-- Valid attributes for fields:
  34.     name: mandatory - the name for the field
  35.     type: mandatory - the name of a previously defined type from the
  36.       <types> section
  37.     indexed: true if this field should be indexed (searchable or sortable)
  38.     stored: true if this field should be retrievable
  39.     multiValued: true if this field may contain multiple values per document
  40.     omitNorms: (expert) set to true to omit the norms associated with
  41.       this field (this disables length normalization and index-time
  42.       boosting for the field, and saves some memory).  Only full-text
  43.       fields or fields that need an index-time boost need norms.
  44.       Norms are omitted for primitive (non-analyzed) types by default.
  45.     termVectors: [false] set to true to store the term vector for a
  46.       given field.
  47.       When using MoreLikeThis, fields used for similarity should be
  48.       stored for best performance.
  49.     termPositions: Store position information with the term vector.  
  50.       This will increase storage costs.
  51.     termOffsets: Store offset information with the term vector. This
  52.       will increase storage costs.
  53.     default: a value that should be used if no value is specified
  54.       when adding a document.
  55.   -->
  56.  
  57.    <field name="nameid" type="string" indexed="true" stored="true" />
  58.    <field name="name" type="text_general" indexed="true" stored="true" />
  59.    <field name="titleid" type="string" indexed="true" stored="true" />
  60.    <field name="title" type="text_general" indexed="true" stored="true" />
  61.  
  62.    <!-- uncomment the following to ignore any fields that don't already match an existing
  63.        field name or dynamic field, rather than reporting them as an error.
  64.        alternately, change the type="ignored" to some other type e.g. "text" if you want
  65.        unknown fields indexed and/or stored by default -->
  66.    <dynamicField name="*" type="ignored" multiValued="true" />
  67.    
  68.  </fields>
  69.  
  70.  <uniqueKey>nameid</uniqueKey>
  71.  
  72.  
  73. </schema>
  74.  
  75.  
  76.  
  77.  
  78.  
  79. errormessge in tomcat-log for every entry of second table:
  80.  
  81. Jun 06, 2013 9:48:56 AM org.apache.solr.handler.dataimport.SolrWriter upload
  82. WARNING: Error creating document : SolrInputDocument[{titleid=titleid(1.0)={99353}, title=title(1.0)={Legal Eagle Feathers His Nest}}]
  83. org.apache.solr.common.SolrException: [doc=null] missing required field: nameid
Advertisement
Add Comment
Please, Sign In to add comment