This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Search engine not working in Production Environment

Questions relating to sfLucenePlugin, sfSearch etc

Search engine not working in Production Environment

by mohamedfasil » Sun Nov 21, 2010 10:25 am

Hi,
My search engine is working perfectly in Development environment but, not in the production environment.
I guess, the problem is related to indexing, So , i did a

Code: Select all
./symfony doctrine:data-load --application=frontend --env=prod


and now, the search is working on the production environment, but not in the development.

and, when doing

Code: Select all
 ./symfony doctrine:data-load


search works perfectly on development but not in Production env,
Anyone, any ideas??
please help me........
mohamedfasil
Junior Member
 
Posts: 6
Joined: Sat Nov 06, 2010 8:46 am

Re: Search engine not working in Production Environment

by halfer » Mon Nov 22, 2010 2:04 pm

What search engine are you using?

What happens when an environment is not working? Do you get an exception, or errors in your logs?
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: Search engine not working in Production Environment

by mohamedfasil » Mon Nov 22, 2010 2:09 pm

The Zend Search engine , which is used in the Jobeet tutorial.
No, I'm not getting any error, and I couldn't find anything associated with this problem in the logs.
Thanks for your help.
mohamedfasil
Junior Member
 
Posts: 6
Joined: Sat Nov 06, 2010 8:46 am

Re: Search engine not working in Production Environment

by halfer » Tue Nov 23, 2010 5:54 pm

Doesn't doctrine:data-load drop your database and then recreate it? If so, you may need to insert the data into each environment/database manually.
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: Search engine not working in Production Environment

by mohamedfasil » Wed Nov 24, 2010 10:36 am

Yeah, Its recreating the tables.
Now why should I add everything manually into my DB?
mohamedfasil
Junior Member
 
Posts: 6
Joined: Sat Nov 06, 2010 8:46 am

Re: Search engine not working in Production Environment

by brainvire » Tue May 13, 2014 12:23 pm

The solution was pretty simple. I added a parameter to the constructor of my service class to inject the session into the service.

In config.yml:
my_service:
class: My\Really\Awesome\Service
arguments:
session: "@session"
In Service.php (my service class):
use Symfony\Component\HttpFoundation\Session\Session;

class Logging
{
private $_session;

public function __construct(Session $session)
{
// INSTEAD OF $this->_session = new Session()
$this->_session = $session;
}

public function doSomething()
{
// Access Session
$value = $this->_session->get('someValue');
}
}
brainvire
Junior Member
 
Posts: 6
Joined: Thu Apr 03, 2014 1:13 pm
Location: 1255 S State St. # 906, Chicago,IL 60605, USA