Anybody know how to make a small search engine for a website?

So, I am working on a school website, and am making a thing for the library where you can search for books and their availability. Well, how would I do that exactly? Javascript I am assuming? If anybody could help I would appreciate it.
Sounds like there should be a database you can query. So, PHP I would imagine.
Ugh. The last thing I wanted to learn. Aw well, I can add that feature later. Much later.
You can use anything you want really via CGI or some mechanism for server-side execution. At least, anything that can query a local database (which is a lot I would imagine).

Javascript is client side so it's probably not the best choice but you probably could if the database allowed remote querying (often not the case for security reasons).
Last edited on
closed account (EwCjE3v7)
Well you will need a list of the books available. And if you are using PHP there are some PHP forums out there that can help
Last edited on
You could even make it in Common Lisp ;)
You can make it in the following languages (AFAIK): Python, Ruby, Perl and PHP (among the common ones). There should be a MySQL or some other database of books and you should create the search interface using the language of your choice. In the back-end, the script will search the database for the books.
Using CGI, you can use C and C++. Don't use C or C++ though. Use something that's easier to maintain and easier to read.
Listen to NoXzema, doing CGI with C++ is just ugly IMO.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;
 
int main ()
{
    
   cout << "Content-type:text/html\r\n\r\n";
   cout << "<html>\n";
   cout << "<head>\n";
   cout << "<title>Hello World - First CGI Program</title>\n";
   cout << "</head>\n";
   cout << "<body>\n";
   cout << "<h2>Hello World! This is my first CGI program</h2>\n";
   cout << "</body>\n";
   cout << "</html>\n";
   
   return 0;
}

[EDIT] Mismatched tags.
Last edited on
Thanks everyone. I didn't expect to get this many answers overnight... but still good. Anyway, I will probably learn some PHP for this. Doesn't seem like it will be easy though.
Use a dedicated framework for it. E.g. Solr (for a small library) or Elastic Search (for a big library).



Topic archived. No new replies allowed.