Skip to content

Commit 82d2732

Browse files
committed
Added documentation on the available console commands and instructions on how to run them.
1 parent f7d6e30 commit 82d2732

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

README.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,60 @@ That prefix setting can be overridden in your config. The following would remove
135135
```
136136

137137

138+
### Limit Element Criteria for Command Imports
139+
140+
This can be used to specify which element criteria to use for each mapping when running batch import commands. If left blank, the plugin will try each of the elements for the specified element type.
141+
142+
```php
143+
...
144+
'mappings' => [
145+
[
146+
'indexName' => 'newsPosts',
147+
'elementType' => 'entry',
148+
'elementCriteria' => [
149+
'section' => ['news']
150+
],
151+
...
152+
],
153+
],
154+
...
155+
```
156+
157+
158+
159+
## Commands
160+
161+
There are a few helpful commands. If you don't already have a command script set up, you can place the included `yiic` file in the same directory as your craft directory. You can then run the commands by navigating to the location of the yiic file in a terminal and running `php yiic algolia` followed by the command name and options, if any.
162+
163+
164+
### Clear An Index Command
165+
166+
Clears and index by name. This will remove all entries from the specified index.
167+
168+
`php yiic algolia clearIndex --name=some_index_name_here`
169+
170+
171+
### Batch Import A Mapping
172+
173+
This will import the elements for the specified index.
174+
175+
`php yiic algolia import --name=some_index_name_here`
176+
177+
178+
### Batch Import All
179+
180+
This will import all elements for all of the indexes.
181+
182+
`php yiic algolia importAll`
183+
184+
138185

139186
***
140187

141188

142189

143190
## Contributions
144191

145-
- [Aaron Waldon](https://github.com/aaronwaldon) / @aaronwaldon - Reworked the logic to allow multiple element types to map to an index and to be able to override the init method from the config. Also added a method to deindex elements.
192+
- [Aaron Waldon](https://github.com/aaronwaldon) / @aaronwaldon - Reworked the logic to allow multiple element types to map to an index and to be able to override the init method from the config. Also added a method to deindex elements and a command to clear an index.
193+
194+
- [Philippe Pérusse](https://github.com/philperusse) / @philperusse - Added the option to mass index elements with a command.

yiic

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
require_once(__DIR__.'/craft/app/etc/console/yiic.php');

0 commit comments

Comments
 (0)