Download the PHP package aoepeople/solr-rest-api-client without Composer

On this page you can find all versions of the php package aoepeople/solr-rest-api-client. 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 solr-rest-api-client

++++++++++++++++++++++++ Solr RESTApi Client ++++++++++++++++++++++++

:Author: Timo Schmidt <[email protected]> :Author: AOE <[email protected]> :Description: PHP Library to communicate with the RestFul API of Apache Solr :Homepage: http://www.searchperience.com/ :Build status: Build Status

Foreword

With appearance of SOLR [Managed Resources](https://cwiki.apache.org/confluence/display/solr/Managed+Resources) feature, our intention was to implement tiny and easy to use PHP API client to communicate to SOLR REST API interface.

Solr client basics

The solr rest api client can be used to manage the following solr entities with the solr rest api:

Synonyms

In solr you can configure a "managed" synonym with the following entry in your schema.xml:

<filter class="org.apache.solr.rest.schema.analysis.ManagedSynonymFilterFactory" managed="mytag" />

When you have defined a managed synonym list as described below you can see it in the list of the manged resources (e.g.: http://localhost:8080/<core/collectionpath>/schema/managed) and manage it with the solr rest api

The following example shows how you can used the api client to manage synonyms with a certain tag:

require '<vendorDir>/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$repository = $factory->getSynonymRepository('localhost',8080,'solr/<yourcore>/');

$synonymCollection = new \SolrRestApiClient\Api\Client\Domain\Synonym\SynonymCollection();

$synonym = new \SolrRestApiClient\Api\Client\Domain\Synonym\Synonym();
$synonym->setMainWord('foo');
$synonym->addWordsWithSameMeaning('bar');
$synonym->addWordsWithSameMeaning('bla');

$synonymCollection->add($synonym);

$result = $repository->addAll($synonymCollection,'mytag');

Stopwords

In solr you can configure a "managed" stopwords with the following entry in your schema.xml:

<filter class="solr.ManagedStopFilterFactory" managed="french" />

When you have defined a managed stopwords list as described below you can see it in the list of the manged resources (e.g.: http://localhost:8080/<core/collectionpath>/schema/managed) and manage it with the solr rest api

The following example shows how you can use the api client to manage stopwords with a certain tag:

require '<vendorDir>/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$repository = $factory->getStopWordRepository('localhost',8080,'solr/<yourcore>/');

$stopwordCollection = new \SolrRestApiClient\Api\Client\Domain\StopWord\StopWordCollection();

$stopword = new \SolrRestApiClient\Api\Client\Domain\StopWord\StopWord();
$stopword->setWord('foo');

$stopwordCollection->add($stopword);

$result = $repository->addAll($stopwordCollection, 'french');

In addition to addAll method some other methods exist in repository like:

Managed Resources

Some resources in solr (e.g. synonyms and stopwords) can be managed as managed resources. To be able to read and write them you need to be able to get them from the solr server.

To manage this, you can use the ManagedResourceRepository.

The following example shows how to get all synonym resources and add a synonym collection to all of them:

require '<vendorDir>/vendor/autoload.php';

$factory = new \SolrRestApiClient\Common\Factory();
$managedResourceRepository  = $factory->getManagedResourceRepository('localhost',8080,'solr/<core/collection>/');
$resources                  = $managedResourceRepository->getAll();

$synonymRepository          = $factory->getSynonymRepository('localhost',8080,'solr/<core/collection>/');
$synonymResources           = $resources->getSynonymResources();

foreach($synonymResources as $synonymResource) {
 $synonymRepository->setResource($synonymResource);

	$synonymCollection = new \SolrRestApiClient\Api\Client\Domain\Synonym\SynonymCollection();

	$synonym = new \SolrRestApiClient\Api\Client\Domain\Synonym\Synonym();
	$synonym->setMainWord("one");
	$synonym->addWordsWithSameMeaning("one#one");
	$synonym->addWordsWithSameMeaning("one#two");
	$synonymCollection->add($synonym);

	$synonymRepository->addAll($synonymCollection);
}


All versions of solr-rest-api-client with dependencies

PHP Build Version
Package Version
Requires guzzle/guzzle Version v3.8.1
php Version >=5.3.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 aoepeople/solr-rest-api-client contains the following files

Loading the files please wait ...