Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.60/5 (5 votes)
Hi all

i have to develop a search engine which will searched text from the local database.i searched in google..got solutions also but i am totaly confused..please help me out in this..
thank you
Posted
Comments
CPallini 26-Sep-12 4:44am    
What is confusing you?
[no name] 26-Sep-12 4:46am    
i got many results but no one is appropriate..so
Sushil Mate 26-Sep-12 5:28am    
Appropriate or Relevant? can you show your search query & what are the results?
[no name] 26-Sep-12 5:34am    
https://www.google.co.in/search?q=search+engine+using+jquery+or+javascript&sugexp=chrome,mod=19&sourceid=chrome&ie=UTF-8#https://www.google.co.in/blank.html
StianSandberg 26-Sep-12 6:21am    
It's impossible to create a search engine using javascript/jquery. You need some serverside programs to do this. You could check out Lucene. Read this article here at codeproject: Lucene.Net ultra fast search for MVC or WebForms site => made easy!

It´s really hard to know what you mean.
If you have only one database and you are searching a table you can do this in sqlquery.

if you use MS sql, then you can do it like this example.

SQL
Select * from Persons where Name like '%'+@searchstringparam+'%'


Where Persons is tablename, Name is Columnname and @searchstringparam is input from user.
 
Share this answer
 
Comments
[no name] 26-Sep-12 6:42am    
what i have is 2 tables with 300 questions each..i have to make a search engine which will compare the entered string in both of that table and will give the output..it's like searching in a online question bank.
Per Söderlund 26-Sep-12 7:25am    
Then it should work with my posted sql selectstatement, then combine the result before showing it to user.
I guess you are doing the query to fetch data from DB.

If you dont understand the sql statement i wrote, you can google "LIKE SQL"
Or read some articles about SQL select statements.

As someone already pointed out. It has to be done on the serverside.
what you want to make? a search engine web site like google , yahoo, bing or you want to make a desktop application in c# to have a local database for some purpose, well if you want to make a website in ASP.net then you have to make a crawler in in asp you can try this link
http://www.charith.gunasekara.web-sphere.co.uk/2010/08/how-to-build-simple-web-spider-using.html

and if you want to make it in C# desktop application you can try this

A Simple Crawler Using C# Sockets[^]


and if non of that is your requirement and you just want to search a specific local database then all you have to need is some SQL quires over the database.
 
Share this answer
 
Comments
[no name] 26-Sep-12 7:18am    
i need it in local databse..and i have 2 table with 300 questions..not getting what query i have to write to check in both the tables..
Abdul Rehman 2050 27-Sep-12 8:47am    
you have to tell the schema of your database for this, so that we would be able to know what type of database is ? and what type of information you want from that tables?
SQL
select * from tbl1
union
select * from tbl2



You can use JOIN. Another way is using a union of two queries

But this will work only if the two tables have the same columns. You can still use this even if the columns are different, but it's a bit tricky and not always efficient...
Post some more info if you haven't figured it yet
 
Share this answer
 
Comments
[no name] 27-Sep-12 1:49am    
i have to fetch different values from both the table..like e.g. from table 1 question,answer and table 2 question,answer, year, name..
In this case how i should write..???
Hello ,

To search requested data in two tables please use below concept :

Please make sure define appropriate index on both tables to reduce query execution cost :

SQL
select qt1.quest_id, qt1.question from questionTable1 qt1
where qt1.question like '%Serach Text%'
Union
select qt2.quest_id, qt2.question from questionTable2 qt2
where qt2.question like '%Serach Text%'




Please let us know if any.
 
Share this answer
 
Comments
[no name] 26-Sep-12 7:33am    
thanks for ur reply..will look forward to get more helps from u..
Per Söderlund 30-Sep-12 5:48am    
This is off the topic but if you have two tables in one database where the columns are the same, I believe you should redo your design.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900