Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When indexing documents, Datafari tries to identify the types of files it is indexing to register the correct extension together with each document. The registered extension is used to provide faceted search and allow allows the user to filter the results of his query by file type. This page exposes the means used by Datafari to perform this detection.

Default Behavior

By default, Datafari will try to guess the extension of the file from the filename. If the URL to a document si is something like:

Code Block
languagebash
file:///a/b/c/someFile.ext

...

Warning

Be aware that using the default behavior on websites that have url like:

Code Block
http://mydomain.net/some/path/getDoc.php?doc=myDocument.pdf

will result in a php type for this document (and all other documents that are retrieved using the same script).

For web crawl in general, it is advised to use the alternative configuration, that uses the Tika extracted type in priority.

Alternative Configuration

The configuration can be change by changing changed in the solrconfig.xml file via the following parameter:

Code Block
<str name="extension.fromname">true</str>

Changing Setting the value of this parameter to false, the tika type guessing system will be used as the main source of information for file types, and the filename will be used as a fallback if the tika information fails.

This parameter is under the the "datafari" updateRequestProcessorChain (near line 1180, but this may obviously change).

Please refer to Manage Solr configuration with Zookeeper to know where the configuration files are located and how to reload the configuration correctly.