1

I want to get some idea how to go about adding asearch bar in my website?

Please note I don't want to create a google api or google search engine. When user search inside my search bar than only results from my website should show up. and not from random websites.

I was thinking:

I was planning on creating a table called "SearchTable". This table will have 3 cols. I can add all links of my website in "Links" cols. and search using the keywords.

Table: SearchTable(ID, Links, keywords)

and I can search by using the following query

SELECT * FROM SearchTable WHERE keywords LIKE '%searchWord%'"

are there any other ways of doing this?

  • The answer would be `YES` but this is probably not what you are looking for. Depending on the ammount of content on your page you could use something like: [Solr](http://lucene.apache.org/solr/) or any [Lucene based option](https://en.wikipedia.org/wiki/Lucene). You could also use google and restrict the results to your page content `site:yourdomain.com`. – surfmuggle Jun 18 '15 at 22:58
  • Is there any link where can I see google restrict to my domain only? –  Jun 19 '15 at 02:49
  • You must be fun to work with: [how-can-i-add-a-google-search-box-to-my-website](http://stackoverflow.com/questions/13822927/how-can-i-add-a-google-search-box-to-my-website) or searching for `embedding google to search on my site` – surfmuggle Jun 19 '15 at 08:09

0 Answers0