-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NodeSearchBundle] Elastic search version 6 support
* [NodeSearchBundle] Elastic search version 6 support * [NodeSearchBundle] Elastic search version 6 support
- Loading branch information
Showing
5 changed files
with
197 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Kunstmaan/NodeSearchBundle/Helper/ElasticSearchUtil.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Kunstmaan\NodeSearchBundle\Helper; | ||
|
||
/** | ||
* Class ElasticSearchUtil | ||
*/ | ||
final class ElasticSearchUtil | ||
{ | ||
/** | ||
* @return bool | ||
*/ | ||
public static function useVersion6() | ||
{ | ||
return (PHP_MAJOR_VERSION == 7 && !class_exists('\Elastica\Tool\CrossIndex')); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/Kunstmaan/NodeSearchBundle/Resources/doc/ElasticSearch.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Elastic search support | ||
|
||
We have added support for Elastic search up to version 6.x. | ||
|
||
## Dynamic configuration | ||
For the mapping and configuration we detect which version of the library your project is using. | ||
Dependencies for using the configuration of version 6 is that your project uses PHP 7 and ruflin/elastica >= 6.0. | ||
|
||
## Difference between versions | ||
|
||
The biggest change in version 6, is that Elastica has dropped support for the "_all" meta field. | ||
(see https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-all-field.html) | ||
|
||
When using version 6.x, then you will no longer be able to use the "include_in_all" and "index => 'not_analysed". | ||
use 'index => false' instead. Also some of the index types have been changed and some fields are no longer indexed (like the 'created' and 'updated' fields). | ||
|
||
### Example | ||
|
||
Some examples of the mapping that have changed (for the kunstmaan_node_search extension): | ||
|
||
``` | ||
'node_id' => [ | ||
'type' => 'integer', | ||
'include_in_all' => false, | ||
'index' => 'not_analyzed' | ||
], | ||
... | ||
'view_roles' => [ | ||
'type' => 'string', | ||
'include_in_all' => true, | ||
'index' => 'not_analyzed', | ||
], | ||
``` | ||
|
||
in | ||
|
||
|
||
``` | ||
'node_id' => [ | ||
'type' => 'integer', | ||
], | ||
... | ||
'view_roles' => [ | ||
'type' => 'keyword', | ||
], | ||
``` | ||
|
||
### Link to elastic search documentation | ||
|
||
https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html |