| <?xml version="1.0" ?> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <config> |
| <jmx /> |
| |
| <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion> |
| |
| <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"> |
| <!-- used to keep RAM reqs down for HdfsDirectoryFactory --> |
| <bool name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</bool> |
| <int name="solr.hdfs.blockcache.blocksperbank">${solr.hdfs.blockcache.blocksperbank:1024}</int> |
| <str name="solr.hdfs.home">${solr.hdfs.home:}</str> |
| <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str> |
| </directoryFactory> |
| <schemaFactory class="ClassicIndexSchemaFactory"/> |
| |
| <dataDir>${solr.data.dir:}</dataDir> |
| |
| <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| |
| <updateHandler class="solr.DirectUpdateHandler2"> |
| <updateLog> |
| <str name="dir">${solr.ulog.dir:}</str> |
| </updateLog> |
| </updateHandler> |
| |
| |
| <updateRequestProcessorChain name="external-version-constraint" default="true"> |
| <!-- this chain uses the processor using the "deleteVersionParam" option |
| so that deleteById requests are translated into updates to preserve the |
| (logically) deleted document in the index with a record of its deleted |
| version. |
| |
| It also demonstrates how to mix in TimestampUpdateProcessorFactory and |
| DefaultValueUpdateProcessorFactory to ensure these logically deleted |
| documents are kept out of searches, but can be cleaned up periodically |
| after some amount of time has elapsed. |
| --> |
| |
| <processor class="solr.DefaultValueUpdateProcessorFactory"> |
| <!-- give all docs a true value to denote that they are alive --> |
| <str name="fieldName">live_b</str> |
| <bool name="value">true</bool> |
| </processor> |
| |
| <!-- process the external version constraint, ignoring any updates that |
| don't satisfy the constraint --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <bool name="ignoreOldUpdates">true</bool> |
| <str name="versionField">my_version_l</str> |
| <str name="deleteVersionParam">del_version</str> |
| </processor> |
| |
| <processor class="solr.DefaultValueUpdateProcessorFactory"> |
| <!-- any doc that makes it this here w/o a live value is a logically |
| deleted doc generated by the previous processor in place of deleteById |
| --> |
| <str name="fieldName">live_b</str> |
| <bool name="value">false</bool> |
| </processor> |
| <processor class="solr.TimestampUpdateProcessorFactory"> |
| <!-- give every doc, including the logically deleted ones, a timestamp --> |
| <str name="fieldName">timestamp_tdt</str> |
| </processor> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| <updateRequestProcessorChain name="external-version-float"> |
| <!-- this chain uses the processor with float based versionField just |
| to sanity check that there are no hardcoded assumptions about the |
| field type used that could byte us in the ass. |
| --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <!-- process the external version constraint, ignoring any updates that |
| don't satisfy the constraint |
| --> |
| <bool name="ignoreOldUpdates">true</bool> |
| <str name="versionField">my_version_f</str> |
| <str name="deleteVersionParam">del_version</str> |
| </processor> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| <updateRequestProcessorChain name="external-version-failhard"> |
| <!-- Uses the default behavior of failing with a 409 version conflict |
| when the external version is too low. |
| --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <str name="versionField">my_version_l</str> |
| <str name="deleteVersionParam">del_version</str> |
| </processor> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| <updateRequestProcessorChain name="external-version-failhard-multiple"> |
| <!-- Uses the default behavior of failing with a 409 version conflict |
| when the external version is too low. |
| |
| If my_version_l is equal to the previous, then checks my_version_f. |
| --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <str name="versionField">my_version_l,my_version_f</str> |
| <str name="deleteVersionParam">del_version,del_version_2</str> |
| </processor> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| |
| <requestHandler name="/select" class="solr.SearchHandler"> |
| </requestHandler> |
| |
| <updateRequestProcessorChain name="no-external-version"> |
| <!-- this chain lets us index docs without a version field. It's to let us test the optional |
| 'supportMissingVersionOnOldDocs' param in the 'external-version-support-missing' chain |
| below. |
| --> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| <updateRequestProcessorChain name="external-version-support-missing"> |
| <!-- this chain sets the supportMissingVersionOnOldDocs param to true so that we can update |
| docs that were originally indexed without an external version field, e.g. by using the |
| 'no-external-version' chain. |
| --> |
| |
| <!-- process the external version constraint, ignoring any updates that |
| don't satisfy the constraint --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <bool name="ignoreOldUpdates">true</bool> |
| <str name="versionField">my_version_l</str> |
| <str name="deleteVersionParam">del_version</str> |
| <bool name="supportMissingVersionOnOldDocs">true</bool> |
| </processor> |
| |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| <updateRequestProcessorChain name="tombstone-config"> |
| <!-- process the external version constraint, ignoring any updates that |
| don't satisfy the constraint --> |
| <processor class="solr.DocBasedVersionConstraintsProcessorFactory"> |
| <str name="versionField">my_version_l</str> |
| <str name="deleteVersionParam">del_version</str> |
| <lst name="tombstoneConfig"> |
| <bool name="foo_b">true</bool> |
| <int name="foo_i">1</int> |
| <long name="foo_l">1</long> |
| <float name="foo_f">1.5</float> |
| <str name="foo_s">bar</str> |
| <str name="foo_ss">bar1</str> |
| <str name="foo_ss">bar2</str> |
| </lst> |
| </processor> |
| <processor class="solr.RunUpdateProcessorFactory" /> |
| </updateRequestProcessorChain> |
| |
| </config> |