@@ -124,11 +124,11 @@ class ElasticSearchQueryBuilder implements QueryBuilderInterface, ProtectedConte
124124 */
125125 public function nodeType ($ nodeType )
126126 {
127- // on indexing, __typeAndSupertypes contains the typename itself and all supertypes, so that's why we can
127+ // on indexing, neos_type_and_supertypes contains the typename itself and all supertypes, so that's why we can
128128 // use a simple term filter here.
129129
130130 // http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html
131- return $ this ->queryFilter ('term ' , ['__typeAndSupertypes ' => $ nodeType ]);
131+ return $ this ->queryFilter ('term ' , ['neos_type_and_supertypes ' => $ nodeType ]);
132132 }
133133
134134 /**
@@ -466,7 +466,7 @@ public function aggregation(string $name, array $aggregationDefinition, string $
466466 * @param string $name
467467 * @return ElasticSearchQueryBuilder
468468 */
469- public function termSuggestions (string $ text , string $ field = '__fulltext .text ' , string $ name = 'suggestions ' ): ElasticSearchQueryBuilder
469+ public function termSuggestions (string $ text , string $ field = 'neos_fulltext .text ' , string $ name = 'suggestions ' ): ElasticSearchQueryBuilder
470470 {
471471 $ suggestionDefinition = [
472472 'text ' => $ text ,
@@ -750,7 +750,7 @@ public function moreLikeThis(array $like, array $fields = [], array $options = [
750750 $ like = is_array ($ like ) ? $ like : [$ like ];
751751
752752 $ getDocumentDefinitionByNode = function (QueryInterface $ request , NodeInterface $ node ): array {
753- $ request ->queryFilter ('term ' , ['__identifier ' => $ node ->getIdentifier ()]);
753+ $ request ->queryFilter ('term ' , ['neos_node_identifier ' => $ node ->getIdentifier ()]);
754754 $ response = $ this ->elasticSearchClient ->getIndex ()->request ('GET ' , '/_search ' , [], $ request ->toArray ())->getTreatedContent ();
755755 $ respondedDocuments = Arrays::getValueByPath ($ response , 'hits.hits ' );
756756 if (count ($ respondedDocuments ) === 0 ) {
@@ -801,24 +801,24 @@ public function query(NodeInterface $contextNode): ElasticSearchQueryBuilder
801801 {
802802 $ this ->elasticSearchClient ->setContextNode ($ contextNode );
803803
804- // on indexing, the __parentPath is tokenized to contain ALL parent path parts,
804+ // on indexing, the neos_parent_path is tokenized to contain ALL parent path parts,
805805 // e.g. /foo, /foo/bar/, /foo/bar/baz; to speed up matching.. That's why we use a simple "term" filter here.
806806 // http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-term-filter.html
807807 // another term filter against the path allows the context node itself to be found
808808 $ this ->queryFilter ('bool ' , [
809809 'should ' => [
810810 [
811- 'term ' => ['__parentPath ' => $ contextNode ->getPath ()]
811+ 'term ' => ['neos_parent_path ' => $ contextNode ->getPath ()]
812812 ],
813813 [
814- 'term ' => ['__path ' => $ contextNode ->getPath ()]
814+ 'term ' => ['neos_path ' => $ contextNode ->getPath ()]
815815 ]
816816 ]
817817 ]);
818818
819819 //
820820 // http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html
821- $ this ->queryFilter ('terms ' , ['__workspace ' => array_unique (['live ' , $ contextNode ->getContext ()->getWorkspace ()->getName ()])]);
821+ $ this ->queryFilter ('terms ' , ['neos_workspace ' => array_unique (['live ' , $ contextNode ->getContext ()->getWorkspace ()->getName ()])]);
822822
823823 return $ this ;
824824 }
@@ -873,7 +873,7 @@ protected function convertHitsToNodes(array $hits): array
873873 * we might be able to use https://github.com/elasticsearch/elasticsearch/issues/3300 as soon as it is merged.
874874 */
875875 foreach ($ hits as $ hit ) {
876- $ nodePath = $ hit [isset ($ hit ['fields ' ]['__path ' ]) ? 'fields ' : '_source ' ]['__path ' ];
876+ $ nodePath = $ hit [isset ($ hit ['fields ' ]['neos_path ' ]) ? 'fields ' : '_source ' ]['neos_path ' ];
877877 if (is_array ($ nodePath )) {
878878 $ nodePath = current ($ nodePath );
879879 }
@@ -908,8 +908,8 @@ protected function convertHitsToNodes(array $hits): array
908908 public function cacheLifetime (): int
909909 {
910910 $ minTimestamps = array_filter ([
911- $ this ->getNearestFutureDate ('_hiddenBeforeDateTime ' ),
912- $ this ->getNearestFutureDate ('_hiddenAfterDateTime ' )
911+ $ this ->getNearestFutureDate ('neos_hidden_before_datetime ' ),
912+ $ this ->getNearestFutureDate ('neos_hidden_after_datetime ' )
913913 ], function ($ value ) {
914914 return $ value != 0 ;
915915 });
@@ -957,7 +957,7 @@ protected function getNearestFutureDate(string $dateField): int
957957
958958 /* Remove exclusion of not yet visible nodes
959959 - range:
960- _hiddenBeforeDateTime :
960+ neos_hidden_before_datetime :
961961 gt: now
962962 */
963963 unset($ mustNot [1 ]);
0 commit comments