2016-04-27 35 views
0

我想在瀏覽器中搜索我的網站,但我的搜索將在我的所有應用程序中搜索並重定向到頁面中的單詞。和algolia但我想要簡單的搜索或包使用。laravel 5.2如何在我的應用程序中創建簡單搜索

我做這種形式

<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想算法,包裝或啓動任何指導。 請任何一個幫助我

回答

0

您可以參考這個 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" => [","] 
    ], 
); 
} 
+0

在您看來彈性搜索是最好的簡單的搜索? –

+0

是的,你可以使用 – Sachin

+0

@Sachin我明白了,但你提供的鏈接已經死了 –

相關問題