From 8b5a3dd2e7bf605ae51fcf4f7a94ca1bc753bce9 Mon Sep 17 00:00:00 2001 From: Andrew Aitken-Fincham Date: Thu, 24 May 2018 14:30:32 +0100 Subject: [PATCH] PR feedback --- docs/en/03_configuration/30_creating_an_index.md | 2 +- docs/en/03_configuration/31_adding_data_to_an_index.md | 6 +++--- docs/en/03_configuration/33_dev_tasks.md | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/03_configuration/30_creating_an_index.md b/docs/en/03_configuration/30_creating_an_index.md index 70fa45a..97bb493 100644 --- a/docs/en/03_configuration/30_creating_an_index.md +++ b/docs/en/03_configuration/30_creating_an_index.md @@ -18,6 +18,6 @@ class MyIndex extends SolrIndex This will create a new `SolrIndex` called `MyIndex`, and it will store the `Title` field on all `Pages` for searching. -You can also skip listing all searchable fields, and have the index figure it out automatically via `addAllFulltextFields()`. This will add any database fields that are `instanceof DBString` to the index. +You can also skip listing all searchable fields, and have the index figure it out automatically via `addAllFulltextFields()`. This will add any database fields that are `instanceof DBString` to the index. Use this with caution, however, as you may inadvertently return sensitive information - it is often safer to declare your fields explicitly. Once you've added this file, make sure you run a [Solr configure](./33_dev_tasks.md) to set up your new index. diff --git a/docs/en/03_configuration/31_adding_data_to_an_index.md b/docs/en/03_configuration/31_adding_data_to_an_index.md index fea4728..08fa3d2 100644 --- a/docs/en/03_configuration/31_adding_data_to_an_index.md +++ b/docs/en/03_configuration/31_adding_data_to_an_index.md @@ -14,7 +14,7 @@ A reindex event will trigger when you make a change in the CMS, via `SearchUpdat ## Manually -If you get desperate, you can create a new page in a build task or something like that: +If the situation calls for it, you can add an object to the index directly: ```php use Page; @@ -23,8 +23,8 @@ $page = Page::create(['Content' => 'Help me. My house is on fire. This is less t $page->write(); ``` -Depending on the size of the index and how much content needs to be updated, it could take a while for your search results to be updated, so try not to panic if your newly-updated page isn't available immediately. +Depending on the size of the index and how much content needs to be processed, it could take a while for your search results to be updated, so your newly-updated page may not be available in your search results immediately. ## Queued jobs -If the queuedjobs module is installed, updates are queued up instead of executed in the same request. Queued jobs are usually processed every minute. Large index updates will be batched into multiple queued jobs to ensure a job can run to completion within common constraints, such as memory and execution time limits. You can check the status of jobs in an administrative interface under `admin/queuedjobs/`. +If the [Queued Jobs module](https://github.com/symbiote/silverstripe-queuedjobs/) is installed, updates are queued up instead of executed in the same request. Queued jobs are usually processed every minute. Large index updates will be batched into multiple queued jobs to ensure a job can run to completion within common constraints, such as memory and execution time limits. You can check the status of jobs in an administrative interface under `admin/queuedjobs/`. diff --git a/docs/en/03_configuration/33_dev_tasks.md b/docs/en/03_configuration/33_dev_tasks.md index d99062e..824bacb 100644 --- a/docs/en/03_configuration/33_dev_tasks.md +++ b/docs/en/03_configuration/33_dev_tasks.md @@ -1,6 +1,8 @@ # Solr dev tasks -There are two dev/tasks that are central to the operation of the module - `Solr_Configure` and `Solr_Reindex`. You can access these through the web, or via CLI. It is often a good idea to run a configure, followed by a reindex, after a code change - for example, after a deployment. +There are two dev/tasks that are central to the operation of the module - `Solr_Configure` and `Solr_Reindex`. You can access these through the web, or via CLI. Running via the web will return "quiet" output by default, but you can increase verbosity by adding `?verbose=1` to the `dev/tasks` URL; CLI will return verbose output by default. + +It is often a good idea to run a configure, followed by a reindex, after a code change - for example, after a deployment. ## Solr configure @@ -14,6 +16,4 @@ This task will upload configuration to the Solr core, reloading it or creating i This task performs a reindex, which adds all the data specified in the index definition into the index store. -If you have the [Queued Jobs module](https://github.com/symbiote/silverstripe-queuedjobs/) installed, then this task will create multiple reindex jobs that are processed asynchronously. Otherwise, it will run in one process. Often, if you are running it via the web, the request will time out. Usually this means the actually process is still running in the background, but it can be alarming to the user. - -If instead you run the task via the command line, you will see verbose output as the reindexing progresses. +If you have the [Queued Jobs module](https://github.com/symbiote/silverstripe-queuedjobs/) installed, then this task will create multiple reindex jobs that are processed asynchronously; unless you are in `dev` mode, in which case the index will be processed immediately (see [processor.yml](/_config/processor.yml)). Otherwise, it will run in one process. Often, if you are running it via the web, the request will time out. Usually this means the actually process is still running in the background, but it can be alarming to the user, so bear that in mind.