You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then add the Elasticquent trait to any Eloquent model that you want to be able to index in Elasticsearch:
80
98
81
99
```php
82
100
use Elasticquent\ElasticquentTrait;
@@ -92,7 +110,11 @@ Now your Eloquent model has some extra methods that make it easier to index your
92
110
93
111
### Elasticsearch Configuration
94
112
95
-
If you need to pass a special configuration array Elasticsearch, you can add that in an `elasticquent.php` config file at `/app/config/elasticquent.php` for Laravel 4, or `/config/elasticquent.php` for Laravel 5:
113
+
By default, Elasticquent will connect to `localhost:9200` and use `default` as index name, you can change this and the other settings in the configuration file. You can add the `elasticquent.php` config file at `/app/config/elasticquent.php` for Laravel 4, or use the following Artisan command to publish the configuration file into your config directory for Laravel 5:
@@ -223,29 +245,6 @@ You can also get the type mapping and check if it exists.
223
245
Book::getMapping();
224
246
```
225
247
226
-
### Setting a Custom Index Name
227
-
228
-
Elastiquent will use `default` as your index name, but you can set a custom index name by creating an `elasticquent.php` config file in `/app/config/`:
| This is the index name that Elastiquent will use for all
241
-
| Elastiquent models.
242
-
*/
243
-
244
-
'default_index' => 'my_custom_index_name',
245
-
246
-
);
247
-
```
248
-
249
248
### Setting a Custom Type Name
250
249
251
250
By default, Elasticquent will use the table name of your models as the type name for indexing. If you'd like to override it, you can with the `getTypeName` function.
0 commit comments