Sometimes we want to update document values in an indexed field more often than other fields. A good solution to this is to use the field type ExternFileField. The ExternalFileField gets values from an external file instead of the index. Such file can easily be changed and update the field after a commit. Hence no documents need to be re-indexed. A field that has ExternalFileField as type is not searchable. The field may currently only be used as a ValueSource in a FunctionQuery.
The external file contains keys and values:
The keys don’t need to be unique.
The name of the external file must be
external_<fieldname>.* and must be placed in the index directory.
A new file type of the type ExternalFileField and field must be added to schema.xml.
keyField="keyField" defVal="1" indexed="false"
stored="false" valType="float" />
<field name="<fieldname>" type="file" />
keyField is the field that contains the keys and
<fieldname> contains the values from the external file.
valType defines the value type of the field.
At Findwise we have used this method for a customer where we wanted to show the most visited pages higher up in the search result. These statistics are changing daily for a lot of pages and we don’t want to re-index all these pages every day.