Download the PHP package elvenstar/statamic-typesense without Composer

On this page you can find all versions of the php package elvenstar/statamic-typesense. 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 statamic-typesense

Statamic Typesense Search Driver

Typesense is a relatively new search engine and the driver code may change as new features are developed. This is still very much a beta or preview until the next typesense release when some of the quirks will be fixed.

Disclaimer: It's a dev release. I would not recommend using this in production until more testing has been done and some core bugs have been resolved.

Installation

The Typesense library also requires a Guzzle adapter, install the appropriate one according to which Guzzle version that Laravel uses.

Publish the typesense.php config file we will use for configuration:

Add the following variables to your env file:

Add the new driver to the statamic.search config file:

Advanced Fields

When you create an index, we will use the auto schema by default. This uses a wildcard field with the name .* to let Typesense automatically detect the type of the fields. We also have to specify that the ID is a string for each schema so we can use our Statamic UUIDs.

You can find these default settings in the config/typesense.php file, and you can add any other default fields (as long as this field exists in every collection!)

If you want to add more advanced options such as facets or sort order, then you can also define these in the config/typesense.php file. You can read more about this in the Typesense documentation.

These options will be merged with the default schema when the index is created on Typesense:

Only the fields you have defined in the indexes in the config/static/search.php file will be saved to Typesense... so you don't need to worry about including index: false in the Schema definitions. If you don't want the field to be included in the search index then don't include it in the indexes array.

Quirks

  1. Typesense requires the schema to be defined before inserting data, if you update the blueprint and fields in Statamic -- you'll need to delete the collection on Typesense and create it again with the new schema.
  2. Typesense returns all fields data, so if your content field is large it can make the search results payload quite large (this should be fixed in the next release).
  3. Typesense with multiple-nodes hasn't been tested yet.

Multisearch Quirks

Multi-search works a bit differently in typesense and it'll return a nested list of results for each index... so you lose a lot of relevancy as you may just get a list of bad results from the first index because it was at the top of the list, while the good results are not shown because the index was last in the list.

To get around this I recommend keeping a default search index that works on the local driver, and connect indexes to specific collections using Typesense.

Then with connect indexes you can use Typesense when you're browsing a specific collection or on the front-end you can use a javascript client to query the results in Typesense.

Front-end examples

  1. Single-index search
  2. Multi-index search

All versions of statamic-typesense with dependencies

PHP Build Version
Package Version
Requires typesense/typesense-php Version ^4.6
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 elvenstar/statamic-typesense contains the following files

Loading the files please wait ....