From 8876a47f0d22ed954ae133e1eabf0bd93200fd98 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 7 Apr 2020 17:22:29 +1200 Subject: [PATCH] NEW Ensure commits are visible to seachers (fixes #274) This is required in situations where autoCommit.openSearcher is set to "false", and you don't want to rely on core restarts to make committed index updates available to new searches. It's already configured like this in the Common Web Platform environments, so this change will mainly affect other environments (such as Silverstripe Platform). To opt out of this new behaviour, set up a custom solrconfig.xml. More details in https://github.com/silverstripe/silverstripe-fulltextsearch/issues/274 --- conf/solr/4/extras/solrconfig.xml | 356 +++++++++++++++--------------- docs/en/06_troubleshooting.md | 17 +- 2 files changed, 193 insertions(+), 180 deletions(-) diff --git a/conf/solr/4/extras/solrconfig.xml b/conf/solr/4/extras/solrconfig.xml index 8e19810..b266a10 100644 --- a/conf/solr/4/extras/solrconfig.xml +++ b/conf/solr/4/extras/solrconfig.xml @@ -16,9 +16,9 @@ limitations under the License. --> - - - + @@ -86,14 +86,14 @@ - - + - + @@ -158,12 +158,12 @@ Index Config - These settings control low-level behavior of indexing Most example settings here show the default value, but are commented out, to more easily see where customizations have been made. - + Note: This replaces and from older versions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> - @@ -175,8 +175,8 @@ Default in Solr/Lucene is 8. --> - @@ -191,7 +191,7 @@ - - + - @@ -222,15 +222,15 @@ can perform merges in the background using separate threads. The SerialMergeScheduler (Lucene 2.2 default) does not. --> - - - + @@ -268,7 +268,7 @@ - @@ -279,11 +279,11 @@ The default Solr IndexDeletionPolicy implementation supports deleting index commit points on number of commits, age of commit point and optimized status. - + The latest commit point should always be preserved regardless of the criteria. --> - @@ -298,12 +298,12 @@ 30MINUTES 1DAY --> - @@ -341,16 +341,16 @@ uncommitted changes to the index, so use of a hard autoCommit is recommended (see below). "dir" - the target directory for transaction logs, defaults to the - solr data directory. --> + solr data directory. --> ${solr.ulog.dir:} - + - - ${solr.autoCommit.maxTime:15000} - false + + ${solr.autoCommit.maxTime:15000} + false - - ${solr.autoSoftCommit.maxTime:-1} + + ${solr.autoSoftCommit.maxTime:60000} - + 1024 @@ -477,7 +477,7 @@ There are two implementations of cache available for Solr, LRUCache, based on a synchronized LinkedHashMap, and - FastLRUCache, based on a ConcurrentHashMap. + FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets and slower puts in single threaded operation and thus is generally faster than LRUCache @@ -502,7 +502,7 @@ initialSize - the initial capacity (number of entries) of the cache. (see java.util.HashMap) autowarmCount - the number of entries to prepopulate from - and old cache. + and old cache. --> - + - + 20 200 @@ -620,10 +620,10 @@ prepared but there is no current registered searcher to handle requests or to gain autowarming data from. - + --> @@ -651,7 +651,7 @@ false - + @@ -730,21 +730,21 @@ - - + spellcheck @@ -990,8 +990,8 @@ - @@ -1034,10 +1034,10 @@ - @@ -1070,7 +1070,7 @@ field value analysis will be marked as "matched" for every token that is produces by the query analysis --> - @@ -1103,18 +1103,18 @@ request parameter that holds the query text to be analyzed. It also supports the "analysis.showmatch" parameter which when set to true, all field tokens that match the query tokens will be marked - as a "match". + as a "match". --> - - @@ -1146,10 +1146,10 @@ all - @@ -1157,29 +1157,29 @@ - explicit + explicit true - + - + - + @@ -1302,11 +1302,11 @@ .01 --> - + wordbreak - solr.WordBreakSolrSpellChecker + solr.WordBreakSolrSpellChecker _text true true @@ -1325,7 +1325,7 @@ --> - - @@ -1375,14 +1375,14 @@ default wordbreak on - true + true 10 5 - 5 + 5 true - true + true 10 - 5 + 5 spellcheck @@ -1399,8 +1399,8 @@ This is purely as an example. - In reality you will likely want to add the component to your - already specified request handlers. + In reality you will likely want to add the component to your + already specified request handlers. --> @@ -1433,11 +1433,11 @@ @@ -1484,8 +1484,8 @@ This is purely as an example. - In reality you will likely want to add the component to your - already specified request handlers. + In reality you will likely want to add the component to your + already specified request handlers. --> 5--> false - + edismax text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4 @@ -1514,12 +1514,12 @@ *:* 10 *,score - + clustering - + - @@ -1582,10 +1582,10 @@ - - @@ -1598,7 +1598,7 @@ - @@ -1608,27 +1608,27 @@ - - - + - - + - - + - - - ]]> - - @@ -1657,8 +1657,8 @@ .,!? - - @@ -1680,15 +1680,15 @@ http://wiki.apache.org/solr/UpdateRequestProcessor - --> + --> - + - + text/plain; charset=UTF-8 - + - + 5 @@ -1815,11 +1815,11 @@ --> - - + + @@ -1828,12 +1828,12 @@ jdbc://.... - + To add a constant value to all docs, use: 5 - + If you want the user to still be able to change it with _value:something_ use this: 5 @@ -1843,7 +1843,7 @@ EditorialMarkerFactory will do exactly that: --> - + diff --git a/docs/en/06_troubleshooting.md b/docs/en/06_troubleshooting.md index 18e66e3..40e302f 100644 --- a/docs/en/06_troubleshooting.md +++ b/docs/en/06_troubleshooting.md @@ -1,13 +1,26 @@ # Troubleshooting +## Newly indexed content only shows in searches after a delay + +First, check how you're running index operations. +In many cases where the `queuedjobs` module is installed, +saving or publishing a record will create a new index job which needs to complete first. +Solr also distinguishes between adding documents to the indexing, +committing them, and making them available to new searches. +In most cases this happens within a few seconds, but +in sometimes it can take up to a minute due to the +`autoSoftCommit` configuration setting defaults in your `solrconfig.xml`. +To find out more detail, read about +[soft vs. hard commits](https://lucidworks.com/post/understanding-transaction-logs-softcommit-and-commit-in-sorlcloud/). + ## Common gotchas * By default number-letter boundaries are treated as a word boundary. For example, `A1` is two words - `a` and `1` - when Solr parses the search term. * Special characters and operators are not correctly escaped * Multi-word synonym issues -* When Dolr indexes are reconfigured and reindexed, their content is trashed and rebuilt +* When Solr indexes are reconfigured and reindexed, their content is trashed and rebuilt -### CWP-specific +## CWP-specific * `solrconfig.xml` customisations fail silently * Developers aren’t able to test raw queries or see output via the