Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL-Server
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 25-Sep-12 23:35pm
Code-Hunt7.1K
Comments
CPallini at 26-Sep-12 4:44am
   
What is confusing you?
snehasish nandy at 26-Sep-12 4:46am
   
i got many results but no one is appropriate..so
Sushil Mate at 26-Sep-12 5:28am
   
Appropriate or Relevant? can you show your search query & what are the results?
snehasish nandy at 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
AlluvialDeposit at 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!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.

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

Where Persons is tablename, Name is Columnname and @searchstringparam is input from user.
  Permalink  
Comments
snehasish nandy at 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.
Söderlund at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
snehasish nandy at 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..
supermind2002 at 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?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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
  Permalink  
Comments
snehasish nandy at 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..???
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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 :

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.
  Permalink  
Comments
snehasish nandy at 26-Sep-12 7:33am
   
thanks for ur reply..will look forward to get more helps from u..
Söderlund at 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)

  Print Answers RSS
0 OriginalGriff 165
1 Sergey Alexandrovich Kryukov 134
2 Sebastiaan Meijerink 131
3 Rana Waqas 110
4 Maciej Los 84
0 Sergey Alexandrovich Kryukov 6,558
1 OriginalGriff 6,288
2 Peter Leow 2,534
3 Abhinav S 2,358
4 Maciej Los 2,352


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100