Hi! all
Please help me. I have an ASP website, and I want to incoporate a search facility on it but I dont know how. can you please give me a starting point
your help will be apprecieted
Thanks
SC Sibiya
<EMAIL snipped>
Hi! all
Please help me. I have an ASP website, and I want to incoporate a search facility on it but I dont know how. can you please give me a starting point
your help will be apprecieted
Thanks
SC Sibiya
<EMAIL snipped>
Quick summary and a practical path forward (build vs outsource)
As mentioned, the fastest option is to outsource indexing (Google/Bing site search). That is fine for small public sites but gives up control and can show ads. As pointed out, if your content is dynamic you normally search the database; if it’s static you can either crawl the files or use a third‑party crawler. ’s point about portal tools is also valid — there are hosted site‑search services if you want an out‑of‑the‑box solution.
If you want to build a Classic ASP search against a SQL database, take these steps:
LIKE queries; for larger sites use SQL Server Full‑Text Search (CONTAINS/CONTAINSTABLE) or an external engine (Lucene/Solr/Elasticsearch) for relevance and performance.Minimal Classic ASP pattern (stored proc + ADO Command)
<%
Const adCmdStoredProc = 4
Const adVarWChar = 202
Const adParamInput = 1
q = Trim(Request.QueryString("q"))
If Len(q) > 0 Then
If Len(q) > 200 Then q = Left(q,200)
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "YourConnectionString"
Set cmd = Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "sp_Search" ' stored proc does the LIKE/CONTAINS
cmd.Parameters.Append cmd.CreateParameter("@q", adVarWChar, adParamInput, 200, "%" & q & "%")
Set rs = cmd.Execute()
' render results...
rs.Close
conn.Close
End If
%> Practical cautions
%term) prevent index use and are slow; prefer full‑text for flexible matching and ranking.LIKE clauses.Useful references: SQL LIKE operator (), Full‑Text Search overview (docs), and OWASP SQL Injection Prevention (cheat sheet).
Jump to Post— JonathanD 16You could just use a Google search engine,
they have the database and the search technology already available, for free
You could just use a Google search engine,
they have the database and the search technology already available, for free
You can use this facility and you can also try your own define search facility. Check some portal who offer search facility within a site.
if ur content is dynamic then u have to use the database while searching, if its manual then search ur webpages.. very simple.. Google to search will not be a good idea as a programmer.. try.. u will get something..
Cheer!!!
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.