Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> How to build a search engine

How to build a search engine

From: Tracy Wang <TWANG_at_DCCCNET.DCCC.EDU>
Date: Tue, 13 Feb 1996 15:19:34 -0500
Message-Id: <9602132024.AA22925@alice.jcc.com>


Hi all:

I have a question on how to build a smart search engine.

I need to store a user entered query phrase from a form into a variable. Then I can pass this variable into another form to excute the query from a database table. The system should bring up a record if the words appeared, not key letters.

For example, if we put EVOLUTION in, the computer should not pull up hit words that have the word EVOLUTION in it such as REVOLUTION or COUNTERREVOLUTION, or If we use DAY CARE, "Billy HoliDAY:CAREer" should not be qualified for the selection.

I solved a part of the problem by using REPLACE function:

       NewVar:=REPLACE(:query_phrase,' ','% ')||'%'; This will rebuild a phrase like "EVOLUTION PROCESS" into "EVOLUTION% PROCESS". Any word like EVOLUTIONARY will be fine.

But how do we deal with the first word in the query_phrase?

  1. NewVar:='%'||REPLACE(:query_phrase,' ','% ')||'%';
    ^ --- no space after "%"
    This will retrieve "Revolution" if a word "Evolution" is entered as a first word.
  2. NewVar:='% '||REPLACE(:query_phrase,' ','% ')||'%';
    ^ --- a space after "%"
    In this case all the records starting with the first query word will not appear on the list.

Any help will be appreciated.
Thanks in Advance.

Tracy Wang
Programmer Analyst
System Computer Technology (SCT) Received on Tue Feb 13 1996 - 15:25:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US