Git Product home page Git Product logo

laravel-search's People

Contributors

dmyers avatar dschniepp avatar mmanos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-search's Issues

Need a contributing file

I'll add a contributing file to make it clear how people can contribute changes for the project.

whereOr

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);

Error in Laravel 4.2.17 - base64_decode() expects parameter 1 to be string, array given

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

Zend adapter - fuzzy search bug

~ 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.

Seed Index with Faker -> Permission denied

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?

Catch Timeout, how?

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

Can't get select field of records, just show me ID array

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,
            ));
        }
    }

I create a function to search, but result just show me a array IDs

    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

I change my function to select field

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 .

Substring matches

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.

Delete index doesn't delete

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.

Searching dates

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!

Scoring

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

Call to undefined method Mmanos\Search\Search::insert()

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

Whoops, looks like something went wrong.

1/1 FatalErrorException in API.php line 118: Call to undefined method Mmanos\Search\Search::insert()
        </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>

Call to undefined method Illuminate\Foundation\Application::bindShared()

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]

Support for Laravel 5.2

Hello,

Does the package support Laravel 5.2+?

I keep getting this error

Fatal error: Call to undefined method Mmanos\Search\Search::search()

Error when using fuzzy search

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.

Error when use

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

Elasticsearch not working

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

Laravel 5.1 error

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

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.