Download the PHP package dnadesign/silverstripe-elemental-textcontentforsearch without Composer

On this page you can find all versions of the php package dnadesign/silverstripe-elemental-textcontentforsearch. 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-elemental-textcontentforsearch

silverstripe-elemental-textcontentforsearch

A set of helper methods to facilitate searching elemental pages

Requirements

Installation

For Silverstripe 4, use version 1.0.0

The following YAML config will enable elements on every Page object, replacing the standard Content rich text field and add access to the getTextContentForSearch method

mysite/_config/elements.yml

Usage

SolrIndex

We recommend you use the TextContentForSearch instead of the ElementForSearch method in your index. This avoids rendering the entire elemental area, which would include images and complex elements, which consumes a lot of resources during render and don't end up in the index anyway.

Configuration

By default, the process will extract any Varchar, Text and HTMLText field from the elements. If you require any other type of fields to be considered for indexing, you ca update the config as follow:

You can exclude fields per element. By default, the Style and ExtraClass fields are excluded as they wouldn't bring any value to the search. To exclude a field, you can either set the config on the class or in the yaml:

or

In reverse, you can add a field in the same way.

or

In addition, you can implement a updateTextFieldsForSearch method on any element or extension to update the list of fields to include in search.

Some elements may have complex relationships that are not explored by the default process. You can implement addTextContentForSearch to concatenate extra content to the final string.

Ultimately, you can manipulate the final string to be return by implementing updateTextContentForSearch method.

By default, every element is considered for indexing. If you wish to exclude an element from the search, you can use the config as follow:

or

Debugging

As it is difficult to see what is being included in the solr index, the module exposes a read only text field with the content generated by the getTextContentForSearch method. You can hide this field by amending the config:

Notes:

To do:


All versions of silverstripe-elemental-textcontentforsearch with dependencies

PHP Build Version
Package Version
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 dnadesign/silverstripe-elemental-textcontentforsearch contains the following files

Loading the files please wait ....