Download the PHP package punktde/elastic-nodesearchservice without Composer

On this page you can find all versions of the php package punktde/elastic-nodesearchservice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package elastic-nodesearchservice

PunktDe.Elastic.NodeSearchService

Latest Stable Version Total Downloads

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.

Installation

The installation is done with composer:

composer require punktde/elastic-nodesearchservice

Compatibility to Flowpack.ElasticSearch.ContentRepositoryAdaptor:

Elastic.NodeSearchService ElasticSearch.ContentRepositoryAdaptor
1 5.x, 6.x
2 7.x

Configuration

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.

ParameterName Description
string term The search term
array searchNodeTypes Array of the search nodetypes
Context context The given node context
NodeInterface startingPoint The defined starting point

These following parameters can be used in the search request to parametrice the query:

ParameterName Description
ARGUMENT_SEARCHNODETYPES Array_Values of the filter NodeTypes.
ARGUMENT_TERM The Searchterm
ARGUMENT_STARTINGPOINT The startingPoint path

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

  2. Use this marker nodeType in your referenceEditor

  3. Use this nodeType within the search strategy condition

All versions of elastic-nodesearchservice with dependencies

PHP Build Version
Package Version
Requires neos/flow Version *
flowpack/elasticsearch-contentrepositoryadaptor Version ^7.0 || ^8.0 || dev-master
neos/neos Version ^5.0 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package punktde/elastic-nodesearchservice contains the following files

Loading the files please wait ....