473,555 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(DESCRIPTI ON) LIKE UPPER('%store%' )
)
UNION
SELECT ID, TEXT
FROM (SELECT ID, (TITLE || ' ' || DESCRIPTION || ' ' || NOTES) TEXT
FROM B
WHERE UPPER(TITLE) LIKE UPPER('%store%' )
OR UPPER(DESCRIPTI ON) 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 6158
Hi
Do the following
1)Please go to tahiti.oracle.c om

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
1752
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 that contained within the page's text. I have done something like this for news articles but these are articles that are stored within a database...
1
1524
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 consistant with the site rather than the Google look. Does Google provide this feature? Where can I learn more? I tried searching on Google but wasnt sure...
5
2961
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 (a wicked phrase). Some but not all of the words of that phrase exist in my website. I reported it and they removed the link but did not give...
39
4365
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 authors of content subconsciously mention the keywords "lately and noticed" within the same brief sentence, the reader may infer "an unintended message"...
3
3160
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 content pages are of type ASPX and ASCX.
8
1762
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 Hotel Name, Street Address and Postcode. We need to make it as simple as possible for users to pick their hotel, but I don't want to put 1600...
1
8917
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 Items. So basicly: If my Items in the List have a property Name, I would like to be able to return with this method all the items that have Name =...
3
1417
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 engine, but usually enough to start with. A while ago I used the Google Search via their SOAP API - it was a pain. The results where often not...
1
464
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 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. ...
0
7542
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8060
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7903
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6176
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5452
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5170
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2034
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.