GithubHelp home page GithubHelp logo

jeroenherczeg / laravel-scout-solr Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 12.0 26 KB

Solr Driver for Laravel Scout

Home Page: http://solr-driver-for-laravel-scout.readthedocs.io

License: MIT License

PHP 100.00%
solr laravel scout search-engine search

laravel-scout-solr's Introduction

Solr Driver for Laravel Scout



Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads Laravel Scout Apache Solr PHP

Documentation

You can read the documentation here.

Problems, questions or comments?

If you have any problems, questions or comments, feel free to submit an issue and I will reply to you as soon as possible.

Prerequisites

Install Laravel Scout.

Install

Install via Composer

$ composer require jeroenherczeg/laravel-scout-solr

Set your SCOUT_DRIVER to solr:

// .env

...

SCOUT_DRIVER=solr

You must add the Scout service provider and the Solr engine service provider in your app.php config:

// config/app.php

'providers' => [
    ...
        /*
         * Package Service Providers...
         */
        Laravel\Scout\ScoutServiceProvider::class,
        ScoutEngines\Solr\SolrProvider::class,
],

Add the Solr configuration to the scout config file:

// config/scout.php

...

    /*
    |--------------------------------------------------------------------------
    | Solr Configuration
    |--------------------------------------------------------------------------
    |
    | Here you may configure your Solr settings. Solr is the popular, blazing
    | -fast, open source enterprise search platform built on Apache Lucene.
    | If necessary, you can override the configuration in your .env file.
    |
    */

    'solr' => [
        'host' => env('SOLR_HOST', '127.0.0.1'),
        'port' => env('SOLR_PORT', '8983'),
        'path' => env('SOLR_PATH', '/solr/'),
        'core' => env('SOLR_CORE', 'scout'),
    ],

Usage

Now you can use Laravel Scout as described in the official documentation

Using Solr with Laravel Homestead

You can install Solr within your Homestead virtual machine.

Add the port forwarding to your Homestead.yaml

// ~/Homestead/Homestead.yaml

...

ports:
    - send: 18983
      to: 8983
      
...

Add the following install steps to your Homestead after.sh script.

// ~/Homestead/after.sh

#!/bin/sh

# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
#
# If you have user-specific configurations you would like
# to apply, you may also create user-customizations.sh,
# which will be run after this script.

# Install Java Runtime Enviroment
sudo apt-get update
sudo apt-get install default-jre -y

# Install Solr 7.5
wget http://www-eu.apache.org/dist/lucene/solr/7.5.0/solr-7.5.0.tgz
tar zxf solr-7.5.0.tgz
cd solr-7.5.0
bin/solr create -c scout
bin/solr start

You will need to recreate your the virtual machine.

vagrant destroy && vagrant up

Once the virtual machine is installed and running, you can access Solr admin on http://127.0.0.1:18983/solr/#/ .

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.