Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Add Elasticsearch 6 support #91

Closed
wants to merge 10 commits into from
Closed

Conversation

intelligide
Copy link

Elastic.co suggests some alternatives. I've decided to use one index per document type due to his scalability.
However, it breaks the compatibility of the current architecture and requires a major version release.

Indices created in Elasticsearch 6.0.0 or later may only contain a single mapping type. Elastic.co now recommend using one index per document type (https://www.elastic.co/guide/en/elasticsearch/reference/6.0/removal-of-types.html#_index_per_document_type). It's the best solution due to his scalability. However, it is no longer possible to search between several types.
'index' => $this->index,
'type' => $builder->index ?: $builder->model->searchableAs(),
'index' => $this->indexPrefix.$builder->model->searchableAs(),
'_type' => $this->type,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we confirm that this param should indeed be _type instead of type?

@IllyaMoskvin
Copy link

It might be unnecessary to upgrade elasticsearch/elasticsearch dependency from ^5.0 to ^6.0. Elasticsearch's roadmap adds support for creating explicit single_type indexes in v.5.6.0.

Please see my comment in #90 for more details.

@@ -24,16 +24,19 @@ class ElasticsearchEngine extends Engine
*/
protected $elastic;

protected $type = 'doc';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future compatibility, consider defaulting $type to _doc instead of doc. See notes under Elasticsearch 7.x in the roadmap.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document mapping type name can't start with '_'.

Copy link

@IllyaMoskvin IllyaMoskvin Dec 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. My bad, it must be reserved for internal use. Thanks for giving it a shot.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stale
Copy link

stale bot commented Sep 20, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 20, 2020
@stale
Copy link

stale bot commented Nov 19, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 19, 2020
@stale stale bot closed this Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants