private void processDocument() {
        // Write the document if we have dropped out of the record element and
        // have indexed some fields.
        if (!document.getValues().isEmpty()) {
            try {
                Partition partition = defaultPartition;
                if (currentEventTime != null) {
                    final Entry<Long, TimePartition> entry = timePartitionTreeMap.floorEntry(currentEventTime);
                    if (entry != null &&
                            entry.getValue().getPartitionFromTime() <= currentEventTime &&
                            entry.getValue().getPartitionToTime() > currentEventTime) {
                        partition = entry.getValue();

                    } else {
                        final TimePartition timePartition = timePartitionFactory.create(index, currentEventTime);
                        timePartitionTreeMap.put(timePartition.getPartitionFromTime(), timePartition);
                        partition = timePartition;
                    }
                }

                final IndexShardKey indexShardKey =
                        indexShardKeyMap.computeIfAbsent(partition, k -> IndexShardKey.createKey(index, k));

                indexer.addDocument(indexShardKey, document);
            } catch (final RuntimeException e) {
                log(Severity.FATAL_ERROR, e.getMessage(), e);
                // Terminate processing as this is a fatal error.
                throw LoggedException.wrap(e);
            }
        }
    }
Sets the locator to use when reporting errors.

@param locator The locator to use.
stroom-index/stroom-index-impl/src/main/java/stroom/index/impl/IndexingFilter.java