mmanos / laravel-search Goto Github PK
View Code? Open in Web Editor NEWA search package for Laravel 5.
License: MIT License
A search package for Laravel 5.
License: MIT License
Anyway to sort the results?
I'll add a contributing file to make it clear how people can contribute changes for the project.
Is is possible to have an orWhere query?
$query->search('title', 'Born In the USA');
$query->where('genre_id', 3);
$query->orWhere('genre_id', 74);
Hi,
When I run the following line on my index:
$results = Search::index('acpdata')->search('campaign_id', 272)->get();
I get this error:
base64_decode() expects parameter 1 to be string, array given
Error is @ line 190 of file /vendor/mmanos/laravel-search/src/Mmanos/Search/Index/Elasticsearch.php
json_decode(base64_decode(array_get($hit, '_source._parameters', array())), true)
Help!
Regards
An Algoila driver would be a great addition.
such as search_after
Hi, the search returns only id and score. I cannot retrieve other fields.
Has anyone else had this issue?
Great package!!
~ modifier must follow word or phrase Fuzzy search is supported only for non-multiple word terms Eg: If search terms contain a dash (-).
Would be nice if the package could escape search queries automatically.
Hi
I have to admit, Im not shure wether this is a bug or a malfunction of my code.
I've installed the dependencies for laravel-search using the zendsearch driver.
When I've tried to seed the index with fake data:
<?php
// Composer: "fzaninotto/faker": "v1.3.0"
use Faker\Factory as Faker;
class FakeTableSeeder extends Seeder {
public function run()
{
$faker = Faker::create();
foreach(range(1, 100) as $index)
{
Search::deleteIndex();
Search::insert(
$faker->randomNumber($nbDigits = NULL),
array(
'title' => $faker->sentence($nbWords = 3),
'content' => $faker->text,
'status' => 'published',
),
array(
'url' => $faker->url
)
);
}
}
}
I received this error.
PS C:\OneDrive\Shared\GitHub\rowbook> php artisan db:seed
Seeded: TableSeeder
[ErrorException]
unlink(C:\OneDrive\Shared\GitHub\rowbook\app\storage/search/default/_0.fdt)
: Permission denied
db:seed [--class[="..."]] [--database[="..."]] [--force]`
I'm developing locally using php artisan to serve the application. How it comes that I receive this error message?
returned results array does not include title and content
Class paginator does not exist
using laravel 5
Im using this library to write info to ES realtime on an adserver. Im wondering how I would be able to catch a timeout and continue instead of stopping the script.
Regards
Hello @mmanos
I am using Zend search lunce with laravel-search , i tested on my local.
"laravel/framework": "5.1.*"
my config
return array(
'default' => 'zend',
'default_index' => 'default',
'connections' => array(
'zend' => array(
'driver' => 'zend',
'path' => storage_path().'/search',
),
'elasticsearch' => array(
'driver' => 'elasticsearch',
'config' => array(
'hosts' => array('localhost:9200'),
),
),
'algolia' => array(
'driver' => 'algolia',
'config' => array(
'application_id' => '',
'admin_api_key' => '',
),
),
),
);
I have a data with 500 records and create Index with function getArticle
public function getArticle(){
$items = Article::skip(0)->take(500)->get();
foreach($items as $key=>$item){
\Search::insert($item->id, array(
'title' => $item->title,
'introtext' => $item->introtext,
'fulltext' => $item->fulltext,
'status' => $item->status,
));
}
}
public function getSearch($kw){
$items = \Search::search(array('title'),$kw,array('fuzzy'=>true))->limit(15,0)->get();
var_dump($items);
}
result
array (size=1)
0 =>
array (size=2)
'id' => string '411' (length=3)
'_score' => float 1
public function getSearch($kw){
$items = \Search::select('id', 'title')->search(array('title'),$kw,array('fuzzy'=>true))->limit(15,0)->get();
var_dump($items);
}
result
array (size=1)
0 =>
array (size=1)
'id' => string '241' (length=3)
what happen, was i doing something wrong .
Just wondering if this will get Laravel 5 support anytime soon.
Is it possible to get a hit for a partial word?
For example, if I search for wild
, I'd like to see results containing wilderness
.
Hey,
Firstly, thanks for this package - Awesome.
I have created a few indexes and in an attempt to build the management side of things, I have found that I can't delete an individual index:
Search::index('users')->deleteIndex();
If I then search for a result, it seems the index still exists. If I then:
curl -XDELETE 'http://localhost:9200/users/'
And repeat the search, the index has been deleted.
In this case I am using ElasticSearch.
I'll take a look to see if I can figure out what is going wrong here. In the meantime, if you can point me in the right direction, that would be awesome.
Cheers.
Hi,
This is a question regarding ranges so mark it please.
My question is that is there support for date search? I`m building a portal and i need to implement ranged search with dates, for example i need to search the posts which were published in the past month.
Thanks!
Is it possible to score some fields in the search higher than others? E.g. when searching for a movie, have the Title at 1.5, while keeping actors or directors at 1.
I'm using the elastic search driver if it helps.
Thanks
How would one go about working with types?
Hello, thank you for the package. Please guide me on how to index my Models with this package and output the results. When trying to run it, I am getting the following errors
</h2>
<div class="block">
<ol class="traces list_exception">
<li> in
<a title="C:\xampp\htdocs\event\app\Http\Controllers\API.php line 118" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">API.php line 118</a>
</li>
</ol>
</div>
Hello,
I have just installed this nice package, but when I try to run any of the codes in the documentation I end up with getting the following error:
Call to undefined method Illuminate\Foundation\Application::bindShared()
[/vendor/mmanos/laravel-search/src/Mmanos/Search/SearchServiceProvider.php]
Hello,
Does the package support Laravel 5.2+?
I keep getting this error
Fatal error: Call to undefined method Mmanos\Search\Search::search()
Elasticsearch 2.3.3 supported?
Hi,
I'm trying to use fuzzy search, but i'm getting an error:
{"error":{"root_cause":[{"type":"query_parsing_exception","reason":"No query registered for [fuzzy_like_this]","index":"default","line":1,"col":67}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"default","node":"hcsfsArwQ9OwOkw0Wrt5TQ","reason":{"type":"query_parsing_exception","reason":"No query registered for [fuzzy_like_this]","index":"default","line":1,"col":67}}]},"status":400}" on line 239 of /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/GuzzleConnection.php
I used this code:
$results = ESearch::search(array('question','keywords'), $question,array('phrase'=>true,'fuzzy'=>1)) ->where('status', 'published') ->get();
When removing fuzzy, the search query is giving me results. I'm using Elasticsearch 1.0.
Hi everyone ,
When i use :
\Search::insert(1, array(
'title' => 'My title',
'content' => 'The quick brown fox...',
'status' => 'published',
));
My app show error :
Argument 1 passed to Elasticsearch\Client::__construct() must be an instance of Elasticsearch\Transport, array given, called in ..../vendor/mmanos/laravel-search/src/Mmanos/Search/Index/Elasticsearch.php on line 38 and defined
Please help me !
Thanks
How are you able to select an index different than the default index?
Is it possible to restrict the result to match the exact search query instead of matching each individual word in the query?
For example: query="multiple words in query".
I only want hits that match the exact phrase "multiple words in query" and not the hits with "multiple", "words", "in" or "query". I've tried using quotes but that didn't do much.
Thanks
Error thrown when indexing:
Argument 1 passed to Elasticsearch\Client::__construct() must be an instance of Elasticsearch\Transport, array given
I have installed elasticsearch/elasticsearch (v2.1.3)
Please look into this matter
there should be an option to search in multiple indexes
Hi.
I need to use some token filter for the search function with accents, as described in the link text of the final.
Is it possible?
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-asciifolding-tokenfilter.html
Thank you for the work, has been very helpful to me.
It would be nice to be able to show highlighted matches in an interface for users.
Hi,
I have some issue with Laravel 5.1.
When I call the facade Search::search() for example, I have an error:
Call to undefined method Mmanos\Search\Search::methodName
It's me or your package is not compatible with Laravel 5.1 ?
With IoC I have no error but the result is an empty array.
Thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.