Download the PHP package cyber-duck/silverstripe-searchly without Composer

On this page you can find all versions of the php package cyber-duck/silverstripe-searchly. 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 silverstripe-searchly

SilverStripe Elastic Search

This package adds the ability to index DataObjects on any Elastic Search instance running on your local environment, on a server such as AWS, or an Elastic Search service such as Searchly.

Latest Stable Version Latest Unstable Version Total Downloads License

Author: Andrew Mc Cormack

For SilverStripe 4.*

Installation

Add the following to your composer.json file and run /dev/build?flush=all

Configuration

Refer to _config/searchly.yml for configuration options.

Setting Your Elastic Search Endpoint

Add a SEARCHLY_BASE_URI var to your .env file with any valid ES endpoint (AWS, searchly etc)

Or for a local docker ES instance or similar

Setting DataObject Indexable Fields and Relations

Models and their relations can be indexed together as one searchable object. To index fields and their relations you can use searchable_* config arrays on your DataObject.

In the example below the relations Tags & ContentBlocks would need their own searchable_* config. When indexing, these relationships will be traversed and a nested objects created.

Performing Actions on a Search Index

Creating a search index instance allow you access to functions to change and manipulate a search index such as creating a new one, adding / removing records etc

createIndex($mappings = [], $settings = [])

Calling this method on your search index instance will build an ES endpoint index. For full configuration for mappings and settings please see the Elastic Search documentation.

deleteIndex()

This method will completely remove the search index from your ES endpoint

resetIndex($mappings = [], $settings = [])

This method will call deleteIndex() and then call createIndex(). Make sure to pass your mappings and settings configuration as you would for createIndex();

index(array $filters = [])

This method will push all the models to the ES endpoint index you specified when creating your search index instance.

In the example below calling index will traverse through all Page and File models, create a JSON representation of them and push them to the ES endpoint index.

You can also apply filters in case you wish to exclude certain model from the index.

You can also see all the data sent to the ES endpoint index by calling index() then getRecords(). This will return an array of JSON objects.

indexRecord(DataObject $record)

Adds a single data object to the ES endpoint index

removeRecord(DataObject $record)

Removes a single data object from the ES endpoint index

Creating an Index Task

The easiest way to create your indexes is to create a SilverStripe task and run it to create / rebuild all your indexes

If you run into PHP time outs with indexing large numbers of models, you can try to increase the execution time

Performing a Search

To perform a search query create a new SearchQuery instance and inject the search term and index name into the constructor.

Configuring Your Search Query

You can control the amount of results returned. Useful for very large data sets.

You can also control AND / OR matching

There is also a custom method for setting analyze_wildcard config to true / false

Or you can build your own highly complex configurations for any situation.

Getting Search Results

To return an array of matched model IDs you can call getIDs()

To return an array of matched objects you can call getHits()

Highlights / matched text can also be returns by calling setHighlight() on the SearchQuery instance and calling getHighlights()

To return the full ES endpoint response object you can call getResponse() on your query object. Useful for debugging.


All versions of silverstripe-searchly with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
guzzlehttp/guzzle Version ~6 || ~7
silverstripe/framework Version ^4
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 cyber-duck/silverstripe-searchly contains the following files

Loading the files please wait ....