Search problem
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27938
Printed Date: 02 April 2026 at 12:33am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Search problem
Posted By: yandr
Subject: Search problem
Date 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?
|
Replies:
Posted By: WebWiz-Bruce
Date 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.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: yandr
Date 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.
|
Posted By: yandr
Date 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
|
Posted By: yandr
Date Posted: 15 October 2009 at 7:56am
|
The same change should be made every time you are writing unicode characters to the database
|
Posted By: WebWiz-Bruce
Date 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.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: yandr
Date 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.
|
Posted By: WebWiz-Bruce
Date 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.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
Posted By: aladin11
Date Posted: 30 March 2010 at 12:51pm
Hello, I have the same problem. Converted to SQL from Access using Upsize Wizard, now username with no-latin charactars can not login. Checking the table in SQL, I see that username is nvarchar (30). Should I change to ntext? (The message field in tblThread is ntext and displayed fine on the forum.) I also try to add "N" as yanbdr mentioned, but don't know where to start.
|
Posted By: WebWiz-Bruce
Date Posted: 30 March 2010 at 4:05pm
Don't change it to ntext as this will make your database work harder than it needs to.
If you are going to try and change it change it from nvarchar to varchar
You should also try changing the page encoding in the includes/setup_options_inc.asp before changing the database data type as it may just be an encoding issue with the wrong encoding being submitted to the server.
------------- https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting
|
|