473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to implement 'search' similar to Google

I am using Oracle9iR2 / JDBC. I need to implement a search facility
similar to google.com on the database I have. There are 20 tables in
the database and around 30000 records in total. I have to search only
in VARCHAR2 and CLOB fields. Each table has an ID (PK) column. How to
write a single query that search these tables for given string.

Here is a sample for quick understanding...
............................................

CREATE TABLE A (ID NUMBER, TITLE VARCHAR2(200), DESCRIPTION CLOB);
CREATE TABLE B (ID NUMBER, TITLE VARCHAR2(200), DESCRIPTION CLOB,
NOTES VARCHAR2(500));

INSERT INTO A VALUES(101, 'Best online shop', 'Amazon.com is one of
the best online book store');
INSERT INTO A VALUES(102, 'Movie of the week', 'Beautiful Mind
featuring...');
INSERT INTO B VALUES(201, 'Page available', 'The page is currently
unavailable', 'no notes');
INSERT INTO B VALUES(202, 'Address bar', 'type the page address in the
Address bar', 'store');

Here is what I am trying... (Please correct)
............................................
SELECT ID, TEXT
FROM (SELECT ID, (TITLE || ' ' || DESCRIPTION) TEXT
FROM A
WHERE UPPER(TITLE) LIKE UPPER('%store%')
OR UPPER(DESCRIPTION) LIKE UPPER('%store%')
)
UNION
SELECT ID, TEXT
FROM (SELECT ID, (TITLE || ' ' || DESCRIPTION || ' ' || NOTES) TEXT
FROM B
WHERE UPPER(TITLE) LIKE UPPER('%store%')
OR UPPER(DESCRIPTION) LIKE UPPER('%store%')
OR UPPER(NOTES) LIKE UPPER('%store%')
)

When I run the individual part of above query it runs fine but after
UNION it gives
SELECT ID, TEXT
*
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected - got CLOB

How to solve the problem. ****OR*** Please suggest RIGHT way of doing
the search (similar to google).

Thanks
Jul 19 '05 #1
1 6147
Hi
Do the following
1)Please go to tahiti.oracle.com

2)register yourself registration is free

3)serach for intermedia.or oracle text
this is exactly what your looking for.

regards
Hrishy
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bissatch | last post by:
Hi, I would like to add a search engine facility onto my website. This way, if anybody uses it to search my site they will be presented with a page of results where their search query matched...
1
by: bissatch | last post by:
Hi, I am aware that Google provides a search function for websites. What I want is possibly an xml file that contains search results of my site where I can provide the design interface...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
39
by: Noticedtrends | last post by:
Can inference search-engines narrow-down the number of often irrelevant results, by using specific keywords; for the purpose of discerning emerging social & business trends? For example, if...
3
by: Mark Kamoski | last post by:
Hi-- Please help. How can one implement a simple site search for an ASP.NET site that consists of ASPX and ASCX content pages? I have a small site (of less than 100 content pages). The...
8
by: Ben Fidge | last post by:
Hi I'm working on a site which requires the users to specify a hotel at which they're staying in London. The complete list of hotels comes to something like 1600 records. Each record consists of...
1
by: Pieter | last post by:
Hi, I have my own custom BindingList, that inherits from BindingList, and implements IComponent. I would like to implement a Find-method, that will allow me to search for a property of my...
3
by: Michael Fesser | last post by:
..oO(Jerry Stuckle) I prefer third-party search engines or my own. A simple index-based engine with ranking is not that hard to write. Of course it's not that powerful than a professional...
1
by: javaq | last post by:
I am using Oracle9iR2 / JDBC. I need to implement a search facility similar to google.com on the database I have. There are 20 tables in the database and around 30000 records in total. I have to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.