|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
problem in search coding...
hey everybody. i've been trying to fix a search engine on a website that i helped develop and i cant figure out the problem. i have everything indexed and the search works fine in the indexing service. the problem seems to be in the asp coding somewhere. when i run a search for something like "kjarfoih" it says 'no search results to display' just like it should. but when i search for something like "smith" it gives me a blank page as if it has found something but can't display it. also, if i search for a more common word, the blank page has a scroll bar on the side as if there should be a lot of results there. i've looked at the search loop in the coding and there are two breaks right near the end of the loop. i figure thats where the blank page is coming from. here is the coding:
Dim Index Set Index = Server.CreateObject("IXSSO.Query") Index.SetQueryFromURL Request.QueryString Index.DefineColumn "dc_description (DBTYPE_WSTR) = d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 dc.description" Index.DefineColumn "dc_title (DBTYPE_WSTR) = d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 dc.title" Index.DefineColumn "dc_subject (DBTYPE_WSTR) = d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 dc.subject" Index.Columns = "filename,HitCount,dc_description,dc_title,dc_subje ct" Index.SortBy = "dc_title" Index.MaxRecords = 300 Dim Results Set Results = Index.CreateRecordset("nonsequential") Response.Write "<html>" Response.Write "<head>" Response.Write "<Title>New Tecumseth Digital History - Search Results</Title>" Response.Write "</head>" Response.Write "<body bgcolor=" & chr(34) & "#F7EFD6" & chr(34) & "LINK=" & chr(34) & "#993333" & chr(34) & "VLINK=" & chr(34) & "#666633" & chr(34) & ">" Response.Write "<table border=0 cellpadding=3 cellspacing=5 width=530>" Response.Write "<tr>" Response.Write "<td>" Response.Write "<div align=" & chr(34) & "center" & chr(34) & ">" Response.Write "<p>" Response.Write "<font face=" & chr(34) & "arial" & chr(34) & " size=3>" Response.Write "<b>Search Results</b>" Response.Write "</font>" Response.Write "</p>" Response.Write "</div>" Response.Write "<p>" Response.Write "<font face=" & chr(34) & "arial" & chr(34) & " size=2>" If Not Results.Eof Then Do While Not Results.Eof Response.Write "<b><a href=" & chr(34) & "/history/database/" Response.Write Results("filename") Response.Write chr(34) & ">" Response.Write Results("dc_title") & chr(34) & "</b></a><br>" Response.Write Results("dc_description") Response.Write "<br><br>" Results.MoveNext Loop Else Response.Write "No results were found." End If Response.Write "</font>" Response.Write "</p>" Response.Write "</td>" Response.Write "</tr>" Response.Write "</table>" Response.Write "</body>" Response.Write "</html>" %> the red area is where i think the problem is. i've managed to get it to display a link if i change this line: Response.Write Results("dc_title") & chr(34) & "</b></a><br>" to this: Response.Write Results("dc_title") & chr(34) & "Blah blah blah"</b></a><br>" but then all of the links say 'blah blah blah'! i've messed around with this line SO much and i cant get it to work properly. anyone have any ideas? the website address is: www.newtecumseth.library.on.ca/history if you need me to post the coding for one of the indexed pages just let me know and i can do that. if you visit the site, you may get some strange errors because i'm constantly messing around with it. |
|
#2
|
||||
|
||||
|
I'm confused, your search seems to be working. However, what I'm getting back is where each match has the following:
"Our listing function is experiencing technical difficulties, however, this link will take you to a page related to your query." With links to a page that did contain the word I searched for. Don't know where you problem is.
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
|
#3
|
|||
|
|||
|
when the results display, it is supposed to show the title of the page and the description of the page but for whatever reason it wont. all i can manage to make it do is show that message. i should also mention that the whole site was moved from one server to a new one so it all had to be re-indexed. maybe that is causing the problem somehow.....
i just found the same problem on another search engine on that site. the address is: http://www.newtecumesth.library.on.ca/banting/main.html i havent fixed this one up at all so you can see what i mean by the blank page thing. try searching for something common and then uncommon and you'll see what i mean with the scroll bar thing. its finding stuff, just not displaying the title/description. could it be a problem in the way it was indexed? like maybe the dc_title and dc_description part? |
|
#4
|
|||
|
|||
|
SUCCESS!! i FINALLY figured it out! turns out i just needed to add meta properties to the property cache and do a rescan of the catalog. now i can finally relax.
|
|
#5
|
||||
|
||||
|
Glad you got it working ... Since I've never used indexes I was trying to see what the issue could be ...
Thanks for posting the resolution to this. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > problem in search coding... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|