4

I have set up SI4T using the unmodified template building blocks for adding indexing data. In the template builder I can see the following index data.

<indexdata>
    <url>/index.aspx</url>
    <title>Home</title>
    <publicationid>23</publicationid>
    <schemaid>1511</schemaid>
    <itemtype>64</itemtype>
    <parentsgid>6</parentsgid>
    <sgid>6</sgid>
    <type>0</type>
    <body>....some body content here.... </body>
    <custom/>
</indexdata>

However, when publishing, and thereby attempting to save the indexing record to Solr, it complains about unknown field 'pubdate'

DEBUG wire - << "HTTP/1.1 400 Bad Request[\r][\n]"
DEBUG wire - << "Server: Apache-Coyote/1.1[\r][\n]"
DEBUG wire - << "Content-Type: application/octet-stream[\r][\n]"
DEBUG wire - << "Content-Length: 111[\r][\n]"
DEBUG wire - << "Date: Fri, 29 Nov 2013 14:45:54 GMT[\r][\n]"
DEBUG wire - << "Connection: close[\r][\n]"
DEBUG wire - << "[\r][\n]"
DEBUG DefaultClientConnection - Receiving response: HTTP/1.1     400 Bad Request
DEBUG headers - << HTTP/1.1 400 Bad Request
DEBUG headers - << Server: Apache-Coyote/1.1
DEBUG headers - << Content-Type: application/octet-stream
DEBUG headers - << Content-Length: 111
DEBUG headers - << Date: Fri, 29 Nov 2013 14:45:54 GMT
DEBUG headers - << Connection: close
DEBUG wire - << "[0x2][0xa2][0xe0].responseHeader[0xa2] [0xe0]&statusP[0x19][0xe0]%QTimeA[0xe0]%error[0xa2][0xe0]#msg?[0x14]
             ERROR: [doc=tcm:23-1956-64] unknown field 'pubdate'[0xe0]$codeP[0x19]"
DEBUG DefaultClientConnection - Connection 0.0.0.0:55800<->192.168.1.252:8080 closed

Where might the pubdate field come from? Would it make sense to add this to the solr schema? (But then, maybe I'd need to add all the fields that are in the indexdata). Any other suggestions would be welcome.

  • Can you post your schema.xml? Or at least the relevant parts? – Raimond Nov 29 '13 at 15:36
  • I have the solr example schema in place. I was looking in the SI4T documentation for any mention that you have to customise the schema, but didn't see anything. Anyway - schema.xml has no mention of 'pubdate'. But then nor does it mention (for example) 'parentsgid'. – Dominic Cronin Nov 29 '13 at 16:04
  • You'll have to use the SI4T example schema, which was pretty undocumented until now. I've updated SI4T's docs and posted a short explanation as answer. – Raimond Nov 29 '13 at 16:37
7

SI4T requires a couple of fields to be configured in Solr's schema.xml in order index content coming from the Tridion CM and the SI4T TBB:

Fields that always need to be present:

  • id : the unique id of the individual item
  • url : the url of the published item
  • pubdate: the last publish date of the item

Additional fields coming from the SI4T TBB

Then, a couple of additional fields will need to be configured, as seen in the XML you post.

Custom Fields

If you change the default TBB to for instance add custom fields, you will also need to define those in schema.xml.

Binary indexing

If you want to index binaries like pdf's or word documents, you will also need configure this separately.

I have created an example schema.xml with further explanation. The example schema.xml is the minimum configuration you need in order to properly index the XML above. From this, you can create or change schema.xml according to your further Solr needs.

  • Couple of small updates. I needed to remove a duplication definition of "field name='type'" and also add version and its fieldType. – Dominic Cronin Nov 29 '13 at 20:13
  • Also got: "multiple values encountered for non multiValued field sgid:"... changed it to multi-valued in the schema. Looks like there are more similar issues, but I'm starting to get the hang of it now. :-) – Dominic Cronin Nov 29 '13 at 20:43
  • Thanks for finding that out Dominic. The example maybe was a bit too hastily written and I'll update it asap. But at least you're getting the hang of it. :) – Raimond Nov 29 '13 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.