2017 © Pedro Peláez
 

symfony-bundle search-bundle

Xi Search Bundle provides you frontend logic for elasticsearch

image

xi/search-bundle

Xi Search Bundle provides you frontend logic for elasticsearch

  • Thursday, July 4, 2013
  • by xi-project
  • Repository
  • 1 Watchers
  • 3 Stars
  • 514 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Search form & result renderer for Symfony2

XiSearchBundle provides simple way to display your search data when you do not know exactly what kind of data to expect., (*1)

You can use XiSearchBundle with any searchengine as XiSearchBundle provides you interfaces that your final search data object structure must implement., (*2)

Installing

deps -file

[XiSearchBundle]
    git=http://github.com/xi-project/xi-bundle-search.git
    target=/bundles/Xi/Bundle/SearchBundle

autoload.php file

<?php
'Xi\\Bundle'       => __DIR__.'/../vendor/bundles',
?>

appKernel.php -file

<?php
            new Xi\Bundle\SearchBundle\XiSearchBundle(), 
?>

routing.yml -file

XiSearchBundle:
    resource: "@XiSearchBundle/Resources/config/routing.yml"
    prefix:   /

config.yml -file

xi_search:
    result_renderer_extensions:
        acmeType: acmeType_renderer_extension
    default_limit: 50

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, (*3)

xiSearchResultCallback: (content) ->
    @searchResult =  $(@element).siblings('.search-result')
    if !@searchResult.length
        $(@element).after('<div class="search-result"></div>')
        @searchResult =  $(@element).siblings('.search-result')

    @searchResult.html(content)

## Integration to ElasticSearch Probably most easiest way to use this bundle is to use it with ElasticSearch because XiSearchBundle provides you premade implementation for it. This however requires [FOQElasticaBundle](https://github.com/Exercise/FOQElasticaBundle) to work. ## Pagination Pagination uses knp-pagination bundle, and it's on by default Suppose the search is retrieved via ajax, there's a jquery plugin included that binds the received pagination's logic to the actual search form with javascript. As the pagination generally uses the search forms default fields, only the indices need configuration. page, term and submit button values can also be overridden ``` coffee $('#search-result-container').xiSearchPaginate indices: ['#xi_searchbundle_searchtype_index_0', '#xi_searchbundle_searchtype_index_1', ...]

For these bindings to work, configure the knp pagination to use the proper pagination template, (*4)

knp_paginator:
    page_range: 9                      # default page range used in pagination control
    default_options:
        page_name: page                # page query parameter name
        sort_field_name: sort          # sort field query parameter name
        sort_direction_name: direction # sort direction query parameter name
        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
    template:
        pagination: XiSearchBundle:Pagination:sliding.html.twig     # sliding pagination controls template
        sortable: KnpPaginatorBundle:Pagination:sortable_link.html.twig # sort link template

The Versions

04/07 2013

2.2.x-dev

2.2.9999999.9999999-dev

Xi Search Bundle provides you frontend logic for elasticsearch

  Sources   Download

The Requires

 

by Avatar xi-project

search elasticsearch elastic elastica

04/09 2012

dev-master

9999999-dev

Xi Search Bundle provides you frontend logic for elasticsearch

  Sources   Download

The Requires

 

by Avatar xi-project

search elasticsearch elastic elastica

04/09 2012

2.1.x-dev

2.1.9999999.9999999-dev

Xi Search Bundle provides you frontend logic for elasticsearch

  Sources   Download

The Requires

 

by Avatar xi-project

search elasticsearch elastic elastica

04/09 2012

2.0.x-dev

2.0.9999999.9999999-dev

Xi Search Bundle provides you frontend logic for elasticsearch

  Sources   Download

The Requires

 

by Avatar xi-project

search elasticsearch elastic elastica

27/08 2012

dev-pagination

dev-pagination

Xi Search Bundle provides you frontend logic for elasticsearch

  Sources   Download

The Requires

 

by Avatar xi-project

search elasticsearch elastic elastica