-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
51 lines (40 loc) · 1.91 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# sfLuceneable15BehaviorPlugin #
==============================
The `sfLuceneable15BehaviorPlugin` is a symfony plugin that enabled the model(s) to be searchable. This plugin use sfPropel15Plugin as an ORM.
## Installation ##
* Install the plugin
git clone git://github.com/nibsirahsieu/sfLuceneable15BehaviorPlugin.git
* Activate the plugin in the `config/ProjectConfiguration.class.php`
[php]
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
...
$this->enablePlugins('sfLuceneable15BehaviorPlugin');
...
}
}
## How to use ##
* Example:
[xml]
<table name="section">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" required="true" primaryString="true" />
<column name="content" type="LONGVARCHAR" required="true" />
<behavior name="luceneable" />
</table>
if you don't supply the parameter values, the behavior will index all columns using `UnStored` method except the primary key (primary key will be indexed Using `Keyword` method).
* Customizing behavior (Note: the parameter for primary key will be ignored, and its will indexed using `Keyword` method)
[xml]
<table name="section">
<column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
<column name="title" type="VARCHAR" required="true" primaryString="true" />
<column name="content" type="LONGVARCHAR" required="true" />
<behavior name="luceneable" >
<parameter name='title' value='text' />
<parameter name='content' value='unstored' />
</behavior>
</table>
## How to Search ##
* $activeRecords = sfPropelLuceneSearch::create($query)->in($model)->find();