Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can anyone help me with the Logic! Pls!

 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Im developing a search engine...can anyone help me with the logic and if possible with the sample code.

Actually the content which are to be searched are in a folder and the meta data about each data item in the folder is stored
in the Oracle datadase

The Database structure is

Name Null? Type
----------------------------------------- -------- ----------------------------
F_ID NOT NULL VARCHAR2(50)
F_NAME NOT NULL VARCHAR2(30)
FILE_EXT NOT NULL VARCHAR2(10)
DATE_CREATION NOT NULL DATE
DATE_LUPDATE NOT NULL DATE
D_ID NOT NULL VARCHAR2(25)
KEYWORDS NOT NULL VARCHAR2(256)
PATH NOT NULL VARCHAR2(256)

the Keyword field holds all the keywords of that particular file. The keywords are stored in sequence seprated by comma
for example the keyword is like "key1,key2,key3,key4".

The user enters the searck key in the search field. The key entered by the user should be searched with all the keywords within
the database..All the match should be listed and on clicking the match that particular file should be invoked..

CAn anyone help me with the logic..

Thanks in advance for the anticipated reply.
 
pradeep jaladi
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can write one Jdbc program with stored procedure with the keys as the input parameters will suit your problem i think.
 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pradeep!

but actually what i want is the procedure for accompalishing the task..I want sample codes..I want sample code for retriving the information and storing the values in a variable and searching the value aganist the Search key and print the result..

The result should be a link to the file..

Pls help! Its kind of Urgent..
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I think this is not the way. You need to start off with some logic, incase having issues, get back to us. We will try our best to give you the best.

Thanks.
 
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Hope the following idea will help u.



U can then navigate thru the resultset to display the filename and other details.. U can then use FileStream Classes to retrieve the content of the file as the user chooses any match from the result.

Could u tell whether u r developing it for web or as a network application.

Hope this helps.

Regards
Roshini
 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank Andeel!

Can u help me with some logic..if what i've mentioned is not the feasible way of searching..

Thanks Roshini!

Thanks for the code..

I have the keywords seperated by commas within keywords field.For Exanple tthe data in the keyword field is "Key1,Key2,Key3" and if the Users Search Key is "Key2", then the Key2 exist in the Keyword field..this kind of searching should be done and the result should be a link to the file..

Can u please help me out in reaching a solution..
 
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code i have given does the work of searching in the db for the record that contains the keyword given as searchstring.

Pls clarify whether its a web based search or simple network application.

If its a network application u have to open the file based on the file name from the record and read the content of it and write through the socket.. and in the other end read the data's from the socket and display.

If Web app, u have to create .html file with hyperlinks that point to URL where the file is located, based on the match selected.

Hope this helps

Regards
Roshini
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaminathan,

Nobody is going to write this for you.
If while writing it yourself, you get tripped up on some detail, we're all more than happy to help out, but only if we see that you are writing it yourself.

If the current project is too complicated for you to grasp, step back a bit and find some JDBC and/or Servlet tutorials. Follow them and then try some simple projects until you feel that you understand things better

Google is your best friend when looking for tutorials:
http://www.google.com/search?hl=en&q=JDBC+TUTORIAL&btnG=Google+Search
http://www.google.com/search?hl=en&lr=&q=SERVLET+TUTORIAL&btnG=Search
http://www.google.com/search?hl=en&lr=&q=SERVLET+JDBC+TUTORIAL&btnG=Search
 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Roshini!

Thanx Ben!

Ben, actually im not expecting anyone of u to write the code..Actually what i want is Sample Code, i mean, if u have ever come across such implementation...pls try to help me with the Sample Code and this is what i'm expecting.

with regards!
Swami
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the code that Roshini posted should be enough to get you going.
S/He's using the SELECT keyword with LIKE and wildcard chars on either end of the entered string.
[ May 11, 2005: Message edited by: Ben Souther ]
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider Regular Expressions if you want to increase the power to the search.
[ May 12, 2005: Message edited by: Byron Estes ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic