Download the PHP package lpi/search-bundle without Composer

On this page you can find all versions of the php package lpi/search-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package search-bundle

search-bundle

The search bundle is a bundle that offer to you a light search engine. It works on lucene search library and include zend components.

Installation

  1. in AppKernel
    new Ivory\LuceneSearchBundle\IvoryLuceneSearchBundle(),
    new Lpi\Bundle\SearchBundle\LpiSearchBundle(),
    

Configuration

  1. in app/config/config.yml

    ivory_lucene_search:
    
        # Index identifier
        search_index:
            # Path to store the index (Required)
            path: %kernel.cache_dir%/search_index
    
            # Index analyser (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.charset.html
            analyzer: ZendSearch\Lucene\Analysis\Analyzer\Common\Text\CaseInsensitive
    
            # Max Buffered documents (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.optimization.maxbuffereddocs
            max_buffered_docs: 10
    
            # Max merge documents (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.optimization.maxmergedocs
            max_merge_docs: 10000 # (default: PHP_INT_MAX)
    
            # Merge factor (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.optimization.mergefactor
            merge_factor: 10
    
            # Index directory permission (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.permissions
            permissions: 0777
    
            # Auto optmized flag (Optional)
            # If this flag is true, each time you request an index, it will be optmized
            # See http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html#zend.search.lucene.index-creation.optimization
            auto_optimized: false
    
            # Query parser encoding (Optional)
            # See http://framework.zend.com/manual/en/zend.search.lucene.searching.html#zend.search.lucene.searching.query_building.parsing
            query_parser_encoding: "UTF-8" # (default: "")
    
  2. For each entities you want to be indexed, you will have to add the "Lpi\Bundle\SearchBundle\Model\IndexableInterface" an entity need to have these 4 methods:
    • getId()
    • getTitle()
    • getSlug()
    • getDescription()
  3. in app/config/config.yml
    lpi_search:
        mappings: 
            - { value: ApplicationLpiEventBundle:Event , path: programmation_detail} #name of the entity you want to be indexed

Usage

Now you have all indexes registered and you want to uses them, really easy!

in a controller for example :

/**
 * @param Request $request
 * @return array
 * @Route("/search", name="path_search")
 * @Template()
 * @Method({"GET", "POST"})
 */
public function searchAction(Request $request) {
    $results = null;
    if ($request->request->has('term') and '' !== $request->request->get('term')) {
        $results = $this->get('lpi_lucene.search')->search($request->request->get('term'));
    }

    return array(
        'results' => $results
    );
}

and the render in your view for example:

{% if results is defined and results|length > 0 %}
    {% for result in results %}
        <div class="col-xs-12">
            <a href="{{ result.url }}" title="{{ result.title }}">
                {{ result.title }}
            </a>
        </div>
    {% endfor %}
{% else %}
    <div class="alert alert-warning">{{ 'search.result.nothing'|trans({}, 'messages') }}</div>
{% endif %}

All versions of search-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
egeloen/lucene-search-bundle Version ~1.0
zendframework/zendsearch Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lpi/search-bundle contains the following files

Loading the files please wait ....