Skip to content

jfarrell/elasticsearch_php_client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElasticSearch PHP client

ElasticSearch is a distributed lucene powered search indexing, this is a PHP client for it

Warning: API WILL CHANGE

Basic usage

require_once "ElasticSearchClient.php";
$transport = new ElasticSearchTransportHTTP("localhost", 9200);
$search = new ElasticSearchClient($transport, "myindex", "mytype");
$search->index(array('title' => 'My cool document'), $id);
$search->get($id);
$search->search('title:cool');

Multiple indexes or types

$search->setIndex(array("one", "two"));
$search->setType(array("mytype", "other-type"));
$search->search('title:cool');

Using the Query DSL

$search->search(array(
    'query' => array(
        'term' => array('title' => 'cool')
    )
);

About

Simple PHP client for ElasticSearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%