PR feedback

This commit is contained in:
Andrew Aitken-Fincham 2018-05-24 14:30:32 +01:00 committed by Daniel Hensby
parent 26a6581f9b
commit 8b5a3dd2e7
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9
3 changed files with 8 additions and 8 deletions

View File

@ -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.

View File

@ -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/`.

View File

@ -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.