-
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
1 parent
1811dba
commit 2f66949
Showing
5 changed files
with
89 additions
and
0 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 +1,3 @@ | ||
nbproject | ||
/Tests/vendor/.composer/ | ||
/Tests/vendor |
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 |
---|---|---|
|
@@ -6,6 +6,49 @@ kind of data to expect. | |
You can use XiSearchBundle with any searchengine as XiSearchBundle provides you interfaces that your | ||
final search data object structure must implement. | ||
|
||
## Installing | ||
|
||
### deps -file | ||
``` | ||
[XiSearchBundle] | ||
git=http://github.com/xi-project/xi-bundle-search.git | ||
target=/bundles/Xi/Bundle/SearchBundle | ||
``` | ||
|
||
### autoload.php file | ||
```php | ||
<?php | ||
'Xi\\Bundle' => __DIR__.'/../vendor/bundles', | ||
?> | ||
``` | ||
|
||
### appKernel.php -file | ||
```php | ||
<?php | ||
new Xi\Bundle\SearchBundle\XiSearchBundle(), | ||
?> | ||
``` | ||
|
||
### routing.yml -file | ||
```yml | ||
XiSearchBundle: | ||
resource: "@XiSearchBundle/Resources/config/routing.yml" | ||
prefix: / | ||
``` | ||
|
||
### extend ajaxForm (from ajaxbundle) and make sure you bind your custom class as your ajax form handler (see ajaxbundle documentation) | ||
|
||
``` coffee | ||
class App.AjaxForm.YourCustomClass extends App.AjaxForm.Default | ||
|
||
xiSearchResultCallback: (content) -> | ||
@searchResult = $(@element).siblings('.search-result') | ||
if [email protected] | ||
$(@element).after('<div class="search-result"></div>') | ||
@searchResult = $(@element).siblings('.search-result') | ||
|
||
@searchResult.html(content) | ||
``` | ||
|
||
## Integration to ElasticSearch | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
if (!@include __DIR__ . '/vendor/autoload.php') { | ||
die("You must set up the project dependencies, run the following commands: | ||
wget http://getcomposer.org/composer.phar | ||
php composer.phar install | ||
"); | ||
} | ||
|
||
spl_autoload_register(function($class) { | ||
if (0 === strpos($class, 'Xi\Bundle\SearchBundle\\') && | ||
file_exists($file = __DIR__ . '/../' . implode('/', array_slice(explode('\\', $class), 3)) . '.php') | ||
) { | ||
require_once $file; | ||
} | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"require": { | ||
"symfony/framework-bundle": "=v2.0.14", | ||
"symfony/form": "=v2.0.14", | ||
"symfony/dependency-injection": "=v2.0.14", | ||
"twig/twig": "1.*" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
bootstrap="bootstrap.php" | ||
> | ||
<testsuites> | ||
<testsuite name="Xi FilelibBundle Test Suite"> | ||
<directory>.</directory> | ||
<exclude>./vendor</exclude> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |