Download the PHP package lmc/cqrs-solr without Composer

On this page you can find all versions of the php package lmc/cqrs-solr. 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 cqrs-solr

LMC CQRS Solr extension

cqrs-types Latest Stable Version Tests and linting Coverage Status

A library containing base implementations to help with Solr Queries and Commands. This library is an extension for CQRS/Bundle and adds support for Solarium requests.

Table of contents

Installation

NOTE: It also requires Solarium and Solarium bundle, which are directly required by this library.

Query

Query is a request which fetch a data without changing anything. See more here

It is allowed and recommended to use a InjectSolrClientInterface with a Solr queries, so you don't need to worry about a Solarium Client, you will simply get it automatically.

AbstractSolrQuery

A base Solr Query, it abstracts and predefine some of a most used features with this kind of a Query.

It implements a ProfileableInterface and CacheableInterface features.

Method Type Description
getRequestType final It declares a request type of a query to be a SolrRequest
createRequest abstract It declares a base QueryInterface method to return a SolrRequest type.
getRequestUrl base It's a predefined method which creates a request and build a solarium request to return a final url.
getCacheTime base It returns a default value for a cache time of 30 minutes.
getCacheKey base It creates a CacheKey out of an Solr endpoint, a static class name (your implementation class name) and a md5 representation of a final url, which should create a unique enough cache key for most queries.
getProfilerId base It's a predefined creating of profiler id for a Solr query. It creates a profiler id based on a final url.
getProfilerData base If you overwrite this method, you can specify additional profiler data. Default is null (no data).
getEndpoint base It returns a Solr endpoint for your Query.
__toString base It's a predefined casting a Query into string, it returns a string representation of a final url.

AbstractSolrSelectQuery

A base Solr Select Query, it abstracts and predefine some of a most used features with this kind of a Query.

It extends a base AbstractSolrQuery and predefine some abstract methods. It also adds InjectSolrClientInterface feature, since it needs a Solarium Client to create a Select Request.

Method Type Description
setOffset base It simply sets an offset (where should select start) for a Solr select request.
setLimit base It simply sets a limit (number of rows) for a Solr select request.
createRequest final It creates a SolrRequest with a prepared Solarium Select.
prepareSelect abstract It requires you prepare a Solr select request. What do you actually wants to select - set of fields and other select properties.

BuilderPrototypeQuery

This is a special type of a SolrSelectQuery it also extends an AbstractSolrSelectQuery and implement prepareSelect method with a usage of QueryBuilder applicators.

It is a Query, which QueryBuilder creates for you.

Query Handlers

It is responsible for handling a specific Query request and passing a result into OnSuccess callback. See more here.

Solr Query Handler

This handler supports Lmc\Cqrs\Solr\ValueObject\SolrRequest (see SolrRequest) and handles it into Solarium\Core\Query\Result\ResultInterface.

It also prepares a Query implementing a InjectSolrClientInterface by injecting a Solarium Client into a Query so it is not required for you to inject a Solarium Client into a query by yourself.


Value Objects

SolrField

It is a representation of any data passed by user to Solr (eg. in query or a list of fields returned by Solr)

SolrRequest

It is a simple Value object containing an Abstract Solarium Query and optionally a Solr endpoint.


Query Builder

Query builder is an abstraction above a Solarium Select Query set up.

The idea is that you have just a data, used in select, stored in an entity. The entity stands for what you want to select and how. And according to interfaces, that this entity implements, the data is passed into a Select Query.

Query Builder builds a CQRS/QueryFetcher with all supported features.

Example

Imagine you need to select 30 Persons with fields Name and Age by search input, stored in a Solr, you would have something like:

With direct Solarium usage you need to create a Select Query yourself and remember all setters and stuff.

Now Query Builder offers a predefined applicators, which knows how the Select query is built and just need a data for the select query.

Example above using a Query Builder would look something like:

Entity Interface

It is a definition interface for a specific feature set you want a query to have.

Note: It is not a complete set of Solr/Solarium Select features, it is just our most used features.

Applicators

Applicator is a service which can apply a specific set of data into a Solarium select query based on implemented Interface. It must implement a ApplicatorInterface.

You can implement your own applicator if you want to mix features or simply use a feature, which does not have an applicator yet.

ApplicatorInterface

It is an interface, which all applicators must implement. It specifies which Entity is current applicator supporting and it can apply its data into Solarium request. It should be able to skip setting a value, if it is empty.

Applicator Factory

It is a service with all defined applicators, its purpose is to return all applicators supporting a given Entity. It is used inside a QueryBuilder to get a list of applicators, which needs to be applied on Select Query.

List of all applicators


All versions of cqrs-solr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-mbstring Version *
lmc/cqrs-types Version ^3.2
nelmio/solarium-bundle Version ^5.0
solarium/solarium Version ^6.2.3
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 lmc/cqrs-solr contains the following files

Loading the files please wait ....