To better understand, and perhaps customise SI4T we have tried opening the org.si4t.solr project in Ecplise.

enter image description here

I don't have a great deal of Java experience, but it looks like we might be missing a JAR file?


What the original question didn't make clear is that we've added all the Tridion 2013 and Solr 4.4.0 libs dependencies but that didn't work.

The Tridion 2011 and Solr < 4.4.0 libs contain the lucene-analyzers-common-4.0.0.jar which does contain the HTMLStripCharFilter class.

However the HTMLStripCharFilter read method is expecting 3 parameters:

public int read(char[] cbuf, int off, int len)

Where the SI4T SolrIndexer.java is only passing a single parameter to it.

HTMLStripCharFilter html = new HTMLStripCharFilter(strReader);
char[] cbuf = new char[1024 * 10];
while (true)
    int count = html.read(cbuf);
    if (count == -1)
        break; // end of stream mark is -1
    if (count > 0)
        out.append(cbuf, 0, count);

We've changed the code to set the offset and length required by the read method.

int count = html.read(cbuf,0,10240);

Is this the correct thing to do, or should we be using a different JAR file?

2 Answers 2


If you follow Dominic's documentation, you'll see that HTMLStripCharFilter has an overloaded read method, so it can take either one or three parameters :o).

Further, the latest release of SI4T does not make use anymore of the HTMLStripCharFilter, because it is wrong to strip chars in that place. It's better to let the Solr indexing mechanism on the server side handle it. Do note the @SuppressWarnings("unused") annotation on that method.

If you really want to use the method, then you have to add lucene-analyzers-common-4.4.0.jar to the class path, in case you use Solr 4.4.0.

  • Hi Raimond, Thanks for getting back to me. I've clicked the link shared by Dominic and there only seems to be two read methods. One that take 0 parameters, and one that takes 3. Its not that i want to use it - i just wanted the code the build without any errors. Jul 23, 2014 at 8:16
  • Then just remove the method :). As said, it's not used.
    – Raimond
    Jul 23, 2014 at 8:26

org.apache.lucene.analysis.charfilter.HTMLStripCharFilter is part of lucene. The documentation can be found here

I would suggest double-checking the documentation on how to set up pre-requisites and configuration for SI4T.

  • Thanks Dominic, this has helped, but not resolved the problem for us. I've updated the question. Jul 23, 2014 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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