Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with postgresql? #12

Closed
shacall2 opened this issue May 24, 2016 · 4 comments
Closed

Work with postgresql? #12

shacall2 opened this issue May 24, 2016 · 4 comments

Comments

@shacall2
Copy link

I've been struggling to get this installed and working. Every time I work through an issue, a new one pops up. Here is my latest error:

[PDOException]
SQLSTATE[08006] [7] invalid connection option "localhostdbname"

TNTSearchServiceProvider.php: I'm using the defaults (except for the driver).

public function register()
    {
        $this->app['tntsearch'] = $this->app->share(function ($app) {
            $config = [
                'driver'   => 'pgsql',
                'host'     => env('DB_HOST', 'localhost'),
                'database' => env('DB_DATABASE'),
                'username' => env('DB_USERNAME'),
                'password' => env('DB_PASSWORD'),
                'storage'  => storage_path(),
            ];

            if (isset($app['config']['services']['tntsearch'])) {
                $config = $app['config']['services']['tntsearch'];
            }
            $tnt = new TNTSearch;
            $tnt->loadConfig($config);
            #dd($tnt);
            return $tnt;
        });
    }

When I dd($tnt) and run php artisan index:users, it displays the correct settings for my postgresql database.

I'm not sure why it's throwing this error. I've checked everywhere in the documentation, and don't see anywhere that indicates postgresql isn't supported.

Appreciate any help!

@nticaric
Copy link
Contributor

There was a small mistake in the data source name. Can you try again with the latest version:
"teamtnt/tntsearch": "dev-master"

@shacall2
Copy link
Author

shacall2 commented May 24, 2016

Thanks @nticaric - that did the trick! I was able to run the index command, which created my index file within storage.

@shacall2
Copy link
Author

@nticaric - one more question for you (didn't see it in the README or other notes). Can I search against multiple tables (join)? Most of my tables just reference a userid, and do not include things like "first name or last name". I need to join a few tables, so I can search against names as well. Thanks!

@nticaric
Copy link
Contributor

Yes, you can use joins. Take a look here #6

sleepless pushed a commit to sleepless/tntsearch that referenced this issue Oct 25, 2017
* commit 'd7da2b336e4648253c61ea8294eef584ca5b07ad':
  ListService: - Switched Division ID 6 from ITC to B2B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants