forked from doctrine/search
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,54 @@ | ||
# Doctrine Search (Solr, Elastic-Search, Lucene, ...) | ||
# Doctrine Search # | ||
|
||
#Todo: convert this into items | ||
__Supported search engines__ | ||
|
||
* [ElasticSearch}(http://www.elasticsearch.org/) | ||
* [Solr](http://lucene.apache.org/solr/) | ||
* [ZendLucene](http://framework.zend.com/manual/en/zend.search.lucene.html) | ||
|
||
## Todo convert this into items ## | ||
* SearchService | ||
* aggregates a ObjectManager instance: $searchManager = new SearchManager($objectManager); | ||
* aggregates a ObjectManager instance: $searchManager = new SearchManager($objectManager); | ||
* supports direct API calls (Solr, Lucene, ... Adapter useable) | ||
* transforms returned ID"s via batch operation into objects | ||
* EventListener for indexing, new SearchIndexListener($backendAdapter); | ||
* uses ObjectManager::getClassMetadata() as the base structure | ||
* adds new Annotationen for more complexe configuration needs | ||
|
||
|
||
## Usage ## | ||
|
||
on the class: | ||
@ORM\Entity | ||
@Search\Searchable | ||
```php | ||
<?php | ||
namespace Entities; | ||
|
||
use Doctrine\Search\Mapping\Annotation as Search; | ||
use Doctrine\ORM\Mapping as ORM; | ||
/** | ||
* @ORM\Entity | ||
* @Search\Searchable | ||
*/ | ||
class Post | ||
{ | ||
/** | ||
* @var integer | ||
* @ORM\Id @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @var string | ||
* @ORM\Column(type="string") | ||
* @Search\Field | ||
*/ | ||
public $title; | ||
|
||
omn field/properties: | ||
@Search\Field(boost=2.0,...) | ||
@Search\SolrField (explcit configuration) | ||
/** | ||
* @var string | ||
* @ORM\Column(type="text") | ||
* @Search\Field | ||
* @Search\SolrField | ||
*/ | ||
public $content; | ||
} |