PHPackages                             punktde/elastic-nodesearchservice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. punktde/elastic-nodesearchservice

ActiveNeos-package[Search &amp; Filtering](/categories/search)

punktde/elastic-nodesearchservice
=================================

Implementation of the Neos NodeSearchServiceInterface using the Elasticsearch index

2.3.0(3y ago)1027.1k↓37.5%3[1 PRs](https://github.com/punktDe/elastic-nodesearchservice/pulls)MITPHP

Since May 12Pushed 2mo ago5 watchersCompare

[ Source](https://github.com/punktDe/elastic-nodesearchservice)[ Packagist](https://packagist.org/packages/punktde/elastic-nodesearchservice)[ RSS](/packages/punktde-elastic-nodesearchservice/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (16)Used By (0)

PunktDe.Elastic.NodeSearchService
=================================

[](#punktdeelasticnodesearchservice)

[![Latest Stable Version](https://camo.githubusercontent.com/580fd65f487f1a44ce95b25f43c81fc720a75d86eac4ad17af30bc9b19e07531/68747470733a2f2f706f7365722e707567782e6f72672f70756e6b7464652f656c61737469632d6e6f6465736561726368736572766963652f762f737461626c65)](https://packagist.org/packages/punktde/elastic-nodesearchservice) [![Total Downloads](https://camo.githubusercontent.com/a3d39f91f0ed27773e5c7b240f414b4e4a2dd631432038f4c367916091faf928/68747470733a2f2f706f7365722e707567782e6f72672f70756e6b7464652f656c61737469632d6e6f6465736561726368736572766963652f646f776e6c6f616473)](https://packagist.org/packages/punktde/elastic-nodesearchservice)

This is an implementation of the Neos NodeSearchService using the Elasticsearch index of the content repository. This vastly reduces the query time for Search-As-You-Type fields in the backend if you have lots of nodes in your project. Additionally it is highly customizable in order to get the best search experience for the project.

Multiple search strategies can be defined which are then selected according to the SearchNodeType, StartingPoint and the term. With this feature you are able to sort news documents returned in a reference selector by publish date while other documents are sorted alphabetically.

Note: While the original database search does a like search in all properties of the document, the default strategy of this package only does a prefix search in the title field. Replace it with the search strategy that fit your needs.

The following example shows a reference selector for news articles with 23 000 Documents.

[![Example](Documentation/elastic-vs-db.gif)](Documentation/elastic-vs-db.gif)

Installation
------------

[](#installation)

The installation is done with composer:

```
composer require punktde/elastic-nodesearchservice

```

Compatibility to [Flowpack.ElasticSearch.ContentRepositoryAdaptor](https://github.com/Flowpack/Flowpack.ElasticSearch.ContentRepositoryAdaptor):

Elastic.NodeSearchServiceElasticSearch.ContentRepositoryAdaptor15.x, 6.x27.xConfiguration
-------------

[](#configuration)

### Example

[](#example)

This example uses a multi\_match prefix query to search in the `punktde_node_search` field indexed for documents.

```
PunktDe:
  Elastic:
    NodeSearchService:
      logRequests: true
      searchStrategies:
        position: end
        titlePrefix:
          condition: '${Array.indexOf(searchNodeTypes, "Neos.Neos:Document")}'
          request:
            query:
              bool:
                filter:
                  bool:
                    minimum_should_match: 1
                    should:
                      - multi_match:
                          query: ARGUMENT_TERM
                          type: bool_prefix
                          fields: ['punktde_node_search', 'punktde_node_search._2gram', 'punktde_node_search._3gram']
		    must:
		      - terms:
			  neos_type_and_supertypes: ARGUMENT_SEARCHNODETYPES
		      - term:
			  neos_parent_path : ARGUMENT_STARTINGPOINT
		    must_not:
		      - term:
			  neos_hidden: true
            _source:
              - __path
            size: 20

```

The `position` determines in which order the strategy conditions are evaluated.

The `condition` is an Eel query, which can be parametrized by the following values. It is used to determine the search strategy to be used. If no search strategy could be found, it falls back to database search.

ParameterNameDescription*string* `term`The search term*array* `searchNodeTypes`Array of the search nodetypes*Context* `context`The given node context*NodeInterface* `startingPoint`The defined starting pointThese following parameters can be used in the search request to parametrice the query:

ParameterNameDescriptionARGUMENT\_SEARCHNODETYPESArray\_Values of the filter NodeTypes.ARGUMENT\_TERMThe SearchtermARGUMENT\_STARTINGPOINTThe startingPoint pathTip: Use a marker nodeType to determine the best search strategy
----------------------------------------------------------------

[](#tip-use-a-marker-nodetype-to-determine-the-best-search-strategy)

Sometimes reference editors for certain nodeTypes profit from custom search strategies. Eg. Only list document nodes that are visible and have a certain property set. We have limited options to determine a search strategy, thus we use the following trick:

1. Define a marker nodeType

```
'Vendor:SearchStrategyMarker.ListableEventSearch':
  abstract: true

```

2. Use this marker nodeType in your referenceEditor

```
    events:
      type: references
      ui:
        inspector:
          editorOptions:
            nodeTypes: ['Vendor:Documents.Event', 'Vendor:SearchStrategyMarker.ListableEventSearch']

```

3. Use this nodeType within the search strategy condition

```
...
        eventSearchTitlePrefix:
          condition: '${Array.indexOf(searchNodeTypes, "Vendor:SearchStrategyMarker.ListableEventSearch") != -1}'
...

```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance58

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~60 days

Recently: every ~189 days

Total

14

Last Release

1412d ago

Major Versions

1.0.1 → 2.0.02020-05-15

1.0.2 → 2.0.12020-05-15

1.0.x-dev → 2.0.22020-05-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fad3b9ab04057e586b701aca7a8dbbf9598718114cdfd6bf85dada030f7688e?d=identicon)[punktde](/maintainers/punktde)

---

Top Contributors

[![daniellienert](https://avatars.githubusercontent.com/u/642226?v=4)](https://github.com/daniellienert "daniellienert (27 commits)")[![jonnitto](https://avatars.githubusercontent.com/u/4510166?v=4)](https://github.com/jonnitto "jonnitto (1 commits)")

---

Tags

elasticsearchneoscmssearchelasticsearchNeos

### Embed Badge

![Health badge](/badges/punktde-elastic-nodesearchservice/health.svg)

```
[![Health](https://phpackages.com/badges/punktde-elastic-nodesearchservice/health.svg)](https://phpackages.com/packages/punktde-elastic-nodesearchservice)
```

###  Alternatives

[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M943](/packages/elasticsearch-elasticsearch)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7431.6M2](/packages/matchish-laravel-scout-elasticsearch)[10up/elasticpress

Supercharge WordPress with Elasticsearch.

1.3k374.3k6](/packages/10up-elasticpress)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[jolicode/elastically

Opinionated Elastica based framework to bootstrap PHP and Elasticsearch implementations.

2571.7M1](/packages/jolicode-elastically)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
