Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Search Bundle Laravel Package

blast-project/search-bundle

View on GitHub
Deep Wiki
Context7

Blast Search Bundle

Bundle that handle search indexes with an ElasticSearch instance.

Requirements

You must have an ElasticSearch running and properly configured

(OPTIONNAL) Using an Elastic Stack stack

Using distribution

sudo apt-get install elasticsearch

Configure your elastic instance to listen to the right network interface by editing /etc/elasticsearch/elasticsearch.yml :

network.host: 0.0.0.0 # change 0.0.0.0 with your public IP or 127.0.0.1 for local exposure only
http.port: 9200

Using Docker

For development purposes only, you can use a complete Elastic Stack (previouly ELK stack).

For simplicity, you can use a Docker image for that stack : https://hub.docker.com/r/sebp/elk/

docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --name elk sebp/elk:611

Note : Don't use ElasticSearch 6 because of a incompatibility between ES 6 and FOSElasticaBundle (see this issue https://github.com/FriendsOfSymfony/FOSElasticaBundle/issues/1267)

You can launch this Docker image at stratup with a custom SystemD service (create the service file /etc/systemd/system/elk.service) :

[Unit]
Description=Start ELK (Elastic search, Logstash and Kibana) at startup
After=network.target
Requires=docker.service

[Service]
Type=simple
KillMode=none
ExecStart=/usr/bin/docker start -a elk
ExecStop=/usr/bin/docker stop -t 5 elk

[Install]
WantedBy=default.target
sudo systemctl daemon-reload
sudo systemctl enable elk

Map your entities with the search index

In a config file, add this content

fos_elastica:
    clients:
        default:
            host: localhost
            port: 9200
    indexes:
        global:
            types:

                # Below is an example about how to map an entity to a search index

                user:
                    properties:
                        username: ~
                        email: ~
                    persistence:
                        driver: orm
                        model: "%sil.model.user.class%"
                        listener: ~ # by default, listens to "insert", "update" and "delete"

Populate indexes

Run the FOSElasticaBundle command bin/console fos:elastica:populate to init elastic search indexes.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware