sahana / vesuvius

Sahana Vesuvius
http://sahanafoundation.org/products/vesuvius/
MIT License
24 stars 27 forks source link

Search does not return any results #7

Closed ravihansa3000 closed 10 years ago

ravihansa3000 commented 10 years ago

Recently, the Search module has not been returning any results, even when there are valid records within the system.

Reproduction steps:

  1. Report a new missing person.
  2. Search for that person.

Imported from Launchpad using lp2gh.

ravihansa3000 commented 10 years ago

(by mayankkrjain) I am not able to reproduce same error on my instance. Please check the value of $conf['enable_solr_for_search'] in sahana.conf. Set it to false if true.

ravihansa3000 commented 10 years ago

(by gurutharshan) Hi, I got a JavaScript date error while I'm searching a person who already exist in the system, but it functionality is working fine i could see the response with relevant search person details from firebug console. Could be a error on viewing part.. when I searched for non existence person system, it works fine and give noticed that search is not found.. Do I have to do any configuration to get this out..

ravihansa3000 commented 10 years ago

(by thevisheshone) ^ I used to get the date error too. But I went into the database and found that some "updated on" columns were missing, so I deleted all the person record and started fresh. Now the error doesn't come but the search always returns "no results found".

ravihansa3000 commented 10 years ago

(by madhu-isuru) Hi, I'm also getting same date error, as Maynk said when I checked $conf['enable_solr_for_search'], but its already set to "false". Then I set that to "true", it will genareate new error messaga saying "Syntax Error" and say - No matches for the search.

Do you think that this is because of problem of my vesuvius instanse .. or ..

ravihansa3000 commented 10 years ago

(by thevisheshone) So finally is this a bug or not?

ravihansa3000 commented 10 years ago

(by rasade88) Mayank, can you provide us with your configuration settings and .htaccess, I don't get how it could work on some instances and not work on others. Thanks

ravihansa3000 commented 10 years ago

(by mayankkrjain) Attached is my sahana.conf file

ravihansa3000 commented 10 years ago

(by mayankkrjain) Here is my .htaccess file

ravihansa3000 commented 10 years ago

(by gurutharshan) I found that system's search works fine from SearchDB.php class, but I had problems with date error Because of 'statusSahanaUpdated' array element set as NULL which is assigned from 'updated' field on 'person_search' table (@ line 297 on mod/inw/SearchDB.php ) even though database contains not null date-time value,

once I have hard coded the datetime value, then search shows correct result in browser..

ravihansa3000 commented 10 years ago

(by mayankkrjain) I tried again to generate any errors related to search. But again I was not able to do so. For me the search work fine even after downloading the codebase again!

ravihansa3000 commented 10 years ago

(by ravihansa3000) Mayank, can you provide us with your PHP configuration? [ php.ini or output of <? phpinfo( ) ?> ] Also what is the browser you are using?

Thanks

ravihansa3000 commented 10 years ago

(by mayankkrjain) Here is the required config file.

ravihansa3000 commented 10 years ago

(by mayankkrjain) Here is the required config file.

ravihansa3000 commented 10 years ago

(by ravihansa3000) This issue is caused by a mis-configuration of MySQL server. Vesuvius search module calls a DB procedure (PLSearch) which uses CONVERT_TZ mysql built-in function to adjust the time zone. If the time zones are not properly configured then it will return 'null' values which is the root cause of this problem. Pl read this article to import the proper time zone conversion values to MySQL server. It fixed the problem on my Ubuntu and Windows environment. Hope this will fix the issue for all. For Win http://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html For Ubuntu/Linux http://www.electrictoolbox.com/mysql-convert-tz-returns-null/

I guess Mayank already has a MySQL server with time zone table configured so it works fine in his machine.

Thanks

ravihansa3000 commented 10 years ago

(by rasade88) Hi Akila,

This fix is appropriate for the bug encountered in environments where the mysql timezone has not been configured, but not for the bug I reported. I am not getting the Javascript error as gurutharshan did. My system simple returns a 'person not found' result when I do a search, although that person is definitely within the system and shown under People I'm Tracking.

ravihansa3000 commented 10 years ago

(by sneha-22-7) I am not able to reproduce the bug. I was getting the Javascript error, then but after configuring the timezone, that error is gone now, and I am also getting the correct search result.

ravihansa3000 commented 10 years ago

(by ravihansa3000) Hi Ramindu, I'm not able to reproduce the bug you mentioned either. After the timezone fix search is working fine. Can you provide us with more detailed steps to reproduce the bug? (with search string, actual db records, etc.)

ravihansa3000 commented 10 years ago

(by ravihansa3000) This might seem bit outdated but I'm posting my personal experience related to this bug for future reference.

I experienced the same behavior when trying to move a database from one system to another. Search module returned 'no records found' even though it did contain valid records. Problem was found to be in database import process. Some of the MySQL routines (namely PLSearch, PLSearch2) have been missed out during db dump import process. I used 'mysqldump' backup program to export the db and I have missed out "--routines" option which exports MySQL routines with the data. I still got the error even after that because of a permission problem. Make sure to remove "DEFINER" directives in the MySQL db dump file when importing otherwise it will throw a permission error. So bottom line, if search is not working, make sure MySQL routines (stored procedures) are in place.

ravihansa3000 commented 10 years ago

(by rasade88) Hi Akila,

Could you outline the procedure you followed to ensure the procedures were imported? They are in my database but search is giving the same error.

Thanks.

ravihansa3000 commented 10 years ago

(by ravihansa3000) Hi Ramindu, Could you post your development environment? PHP version, Apache version, MySQL version, OS.

ravihansa3000 commented 10 years ago

(by akshayproductions) Search works fine for me.