laravel 5.2 如何在我的应用程序中创建简单的搜索

laravel 5.2 how can i create simple search in my application

我想在我的网站中添加搜索,就像浏览器的搜索一样,但我的搜索将在我的所有应用程序中搜索,并重定向到 it.I 中的页面字词阅读关于弹性和 algolia 的简单内容但我想要简单的搜索或要使用的包。

我做了这个表格

<div class="col-sm-3">
                        <form method="GET"  action="{{url('search')}}" class="searchform">
                            <input type="text" placeholder="Search" name="search" style="float: left;"/>
                            <button type="submit"  ><i class="fa fa-search"></i></button>
                        </form>
                    </div>

并且不知道如何begin.I想要算法、包或任何指导来启动。 请任何人帮助我

你可以参考这个 http://fullstackstanley.com/read/simple-search-with-laravel-and-elasticsearch

设置 Elasticquent

<?php
use Elasticquent\ElasticquentTrait;

class Post extends \Eloquent {
  use ElasticquentTrait;

  public $fillable = ['title', 'content', 'tags'];

  protected $mappingProperties = array(
    'title' => [
      'type' => 'string',
      "analyzer" => "standard",
    ],
    'content' => [
      'type' => 'string',
      "analyzer" => "standard",
    ],
    'tags' => [
      'type' => 'string',
      "analyzer" => "stop",
      "stopwords" => [","]
    ],
  );
}