McNolan
McNolan
Small issue is that this would break if a user wants to include a data field named "include" or "exclude". I think it would be better to have a consistent...
Elasticquent does not support split read/write indices currently. I'm holding out for the ElasticSearch "is_write_index" feature that should provide the same benefits and only require a single alias. https://www.elastic.co/guide/en/elasticsearch/reference/6.x/indices-rollover-index.html
I override getTypeName() on the model to return "_doc", but apparently an empty string works as well (see https://github.com/elasticquent/Elasticquent/issues/169).
(Edit: this was in response to a now-deleted comment) The "_doc" type wasn't introduced until 6.2.0, so you probably need to upgrade your cluster. https://github.com/elastic/elasticsearch/pull/27816
There's a pull request for that (#143), but it's not a current feature. Unless that gets merged you'll have to handle it through try-catch block.
Returning 10 results is the default behaviour of ElasticSearch (see https://www.elastic.co/guide/en/elasticsearch/reference/6.x/search-request-from-size.html) @lord-zeus you should specify the "size" parameter in your query
@manounou, use searchByQuery() or complexSearch(). If you really need the "_all" field, the link provided by @pridit explains how to enable it in ElasticSearch (https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html#enabling-all-field).
@manounou I don't use ElasticQuent to manage my mappings, so I've never tried that. Kindly report back when you figure it out.
Extend ElasticquentCollection or add "use ElasticquentCollectionTrait;" to your Eloquent models
@Olegars, your code doesn't match the error. Your sample shows "ElasticquentTrait", but the error shows "ElasticquentCollection". Regardless, note that ElasticquentCollectionTrait has "addToIndex()", while ElasticquentTrait has "addAllToIndex()".