| Author |
Topic Search Topic Options
|
yandr
Groupie
Joined: 10 March 2009
Status: Offline
Points: 106
|
Post Options
Thanks(0)
Quote Reply
Topic: Search problem Posted: 14 October 2009 at 9:04am |
|
I recently upgraded from version 8.x to 9.x and also from Access to SQL Server.
My problem is that searching does not work correctly anymore.
For popular searches it seems to be returning only 100 results (is this a feature?)
There are also problems with non-latin characters. Sometimes it returns results, sometimes it doesn't.
Is there a way to reset the 'search engine'? Any other recommendations?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 October 2009 at 9:10am |
|
If you are searching for posts then it will return the first 100 results. This is to prevent overloading your system and most people are not going to look through 100 results, if they get 100 results then they would more likely search with a larger criteria to shorten down their search results.
The issue you mention with non-latin characters should like a character encoding issue. You need to set the same character encoding in your forum as you previously used so that the submitted search criteria matches that in the database. Having moved from Access to SQL Server may have also changed the character encoding, which may mean only new posts that have the same character encoding as your forum will be found.
|
|
|
 |
yandr
Groupie
Joined: 10 March 2009
Status: Offline
Points: 106
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 7:46am |
|
Thank you for your fast response.
Actually, it seems to be more complicated than that.
Some words return results from old messages (before the upgrade) and some do not return any results at all (even from today's message).
Moreover, although the topics, messages, pms etc display correctly, the guestname in non-latin characters (Greek to be exact) do not display correctly. Does that mean the collation is different in the tblGuestnames table?
I will be investigating this further. Let me know if you are interested in any finding, or if you have anything else to offer.
Thank you in advance.
|
 |
yandr
Groupie
Joined: 10 March 2009
Status: Offline
Points: 106
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 7:54am |
|
Finding No1: The guestname problem is resolved in the new_post.asp by using an extra N in the insert statement for Unicode characters.
If lngLoggedInUserID = 2 AND strGuestName <> "" Then 'Initalise the SQL string with an SQL update command to update the date of the last post in the Topic table strSQL = "INSERT INTO " & strDbTable & "GuestName (" & _ "Name, " & _ "Thread_ID " & _ ") " & _ "VALUES " & _ "(N'" & strGuestName & "', " & _ "'" & lngMessageID & "' " & _ ")" 'Write the updated date of last post to the database adoCon.Execute(strSQL) End If
|
 |
yandr
Groupie
Joined: 10 March 2009
Status: Offline
Points: 106
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 7:56am |
|
The same change should be made every time you are writing unicode characters to the database
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 10:34am |
|
It sounds like your convertion from Access to SQL Server you are using NVARCHAR as the datatype. Web Wiz Forums using VARCHAR and TEXT datatypes for storing string data.
This is probally why you are getting the problems you are. If you are not using NVARCHAR then you do not need to place the N into the SQL.
I would change your datatypes to match that used by Web Wiz Forums SQL Server version or you will get problems such as search issue, display issues, etc.
|
|
|
 |
yandr
Groupie
Joined: 10 March 2009
Status: Offline
Points: 106
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 11:01am |
|
Well, for unicode characters you have to use NVARCHAR. Don't you?
In any case, placing the N in every query that uses unicode characters solved the problem for me.
This included the function to login (yes, some users select Greek usernames), searching, etc.
Thank you Bruce.
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 October 2009 at 11:10am |
|
No you do not need to use NVARCHAR. Web Wiz Forums SQL Server database doesn't use this and is used on many 1,000's Greek, Russian, Chinese, Turkish, and other websites using Non-Latin Character sets.
I only made the suggestion that you should try and replicate the same datatypes in your own database as Web Wiz Forums database uses by default to prevent other errors and upgrade issues.
But that choice is up to you. However we would be unable to give you support for a database with these types of changes.
Edited by WebWiz-Bruce - 15 October 2009 at 11:14am
|
|
|
 |