wu :: forums
« wu :: forums - Database Search »

Welcome, Guest. Please Login or Register.
Nov 23rd, 2024, 6:59pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   microsoft
(Moderators: william wu, SMQ, ThudnBlunder, towr, Grimbal, Eigenray, Icarus)
   Database Search
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Database Search  (Read 8743 times)
mad
Junior Member
**





   


Posts: 118
Database Search  
« on: Feb 5th, 2008, 5:56am »
Quote Quote Modify Modify

How do you search for a word in a large database?
Suggest efficient data structures, algorithms or indices for the same.
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Database Search  
« Reply #1 on: Feb 5th, 2008, 6:13am »
Quote Quote Modify Modify

Is the question like: how to implement a database?
 
What kind of database is it?  Is it like a dictionary and you search the definition of a word, or is it like a documents database and you search where the word appears?
IP Logged
mad
Junior Member
**





   


Posts: 118
Re: Database Search  
« Reply #2 on: Feb 6th, 2008, 9:53am »
Quote Quote Modify Modify

Say it is a database of documents and you search where the word appears
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Database Search  
« Reply #3 on: Feb 6th, 2008, 10:08am »
Quote Quote Modify Modify

Create for each word the list of documents where it appears.
 
It is quite easy.  Create one file for each word.  The file being conveniently named after the file.  Parse all the documents, and every time you find a word you write the name of the document in the file.
 
Well, maybe you should first remove duplicates from the document.
 
So: for each document, parse the document and store a list of unique words in a hash table.  Then, for each word, append the ID fo the document at the end of the file named after the word.  Create the files as necessary.
« Last Edit: Feb 6th, 2008, 10:09am by Grimbal » IP Logged
iatkrox
Newbie
*





   
WWW

Gender: male
Posts: 45
Re: Database Search  
« Reply #4 on: Jul 2nd, 2012, 9:49am »
Quote Quote Modify Modify

Make a search bot !!! Then he will do the work for you  Wink
IP Logged
kylajams
Newbie
*





   


Posts: 2
Re: Database Search  
« Reply #5 on: Aug 27th, 2012, 3:35am »
Quote Quote Modify Modify

Even I wish to know the answer.
IP Logged
kentonson
Newbie
*





   


Posts: 1
Re: Database Search  
« Reply #6 on: Nov 7th, 2012, 8:11am »
Quote Quote Modify Modify

Any new algorithm for searching Roll Eyes I wish to know well ...
 
 
IP Logged
cartoonle
Junior Member
**





   
WWW

Gender: male
Posts: 56
Re: Database Search  
« Reply #7 on: Dec 13th, 2012, 4:01am »
Quote Quote Modify Modify

You should build a inverted index like search engines do. The best for this job are NoSQL databases like Big table from Google.
IP Logged

friv - something i've built
webtasarim
Newbie
*





  http://www.yelidesign.net   http://www.yelidesign.net
WWW

Gender: male
Posts: 47
Re: Database Search  
« Reply #8 on: Oct 6th, 2013, 4:40pm »
Quote Quote Modify Modify

i m gonna use simple words
IP Logged
pratisaad
Newbie
*





   


Posts: 1
Re: Database Search  
« Reply #9 on: Oct 10th, 2013, 5:17am »
Quote Quote Modify Modify

Microsoft SQL is the good database for security purpose.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Database Search  
« Reply #10 on: Oct 10th, 2013, 8:58am »
Quote Quote Modify Modify

That's both doubtful and irrelevant.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Database Search  
« Reply #11 on: Oct 10th, 2013, 3:07pm »
Quote Quote Modify Modify

Yeah, but if it's Microsoft who asks at a job interview...
« Last Edit: Oct 10th, 2013, 3:07pm by Grimbal » IP Logged
webtasarim
Newbie
*





  http://www.yelidesign.net   http://www.yelidesign.net
WWW

Gender: male
Posts: 47
Re: Database Search  
« Reply #12 on: Oct 21st, 2013, 3:42am »
Quote Quote Modify Modify

binary search algorithm can be the best one .
 
In computer science, a binary search or half-interval search algorithm finds the position of a specified input value (the search "key") within an array sorted by key value.[1][2] In each step, the algorithm compares the search key value with the key value of the middle element of the array. If the keys match, then a matching element has been found and its index, or position, is returned. Otherwise, if the search key is less than the middle element's key, then the algorithm repeats its action on the sub-array to the left of the middle element or, if the search key is greater, on the sub-array to the right. If the remaining array to be searched is empty, then the key cannot be found in the array and a special "not found" indication is returned.
A binary search halves the number of items to check with each iteration, so locating an item (or determining its absence) takes logarithmic time. A binary search is a dichotomic divide and conquer search algorithm.
 
source : wikipedia.org
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Database Search  
« Reply #13 on: Oct 21st, 2013, 4:35am »
Quote Quote Modify Modify

Binary search is useless in locating occurences of a word in a set of documents.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board