Home » Developer & Programmer » Forms » an indexing problem!
an indexing problem! [message #153529] Tue, 03 January 2006 00:34 Go to next message
oraclekid
Messages: 5
Registered: January 2006
Location: Pakistan
Junior Member
Respected Friends!

I am inserting PDF files and DOC files in the database through
OLE container, in a form.

Now, i do indexing on the files, by using ...

Create index mytable_index on dummy_blob(attachment) indextype is ctxsys.context;

The problem is that, when i search for a particular string, like, "Hello World", in a PDF/DOC by using ...

select token_text from dr$mytable_index$i

At the SQL prompt, i get a lot of garbage values, like,

TOKEN_TEXT
----------------------------------------------------------------
ÞƒW
ÞƒX
ÞƒY
ÞƒYCÝŸZ

How can i get rid of this garbage stuff?
Re: an indexing problem! [message #153571 is a reply to message #153529] Tue, 03 January 2006 03:40 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
Try using inso_filter:

Create index mytable_index
on dummy_blob(attachment)
indextype is ctxsys.context
PARAMETERS ('FILTER CTXSYS.INSO_FILTER')
/
Re: an indexing problem! [message #153572 is a reply to message #153529] Tue, 03 January 2006 03:45 Go to previous messageGo to next message
oraclekid
Messages: 5
Registered: January 2006
Location: Pakistan
Junior Member
I tried the INSO filter, but that does not help.

I have a table, with a BLOB column, which has a document stored in it. How can i display it, as a thumnail, or an icon, in an OLE, in a form?

If i can display the blob, the indexing would be fine.
Re: an indexing problem! [message #153574 is a reply to message #153572] Tue, 03 January 2006 03:59 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
I thought that the problem was with indexing and searching, not displaying. I will move this thread from the text forum to the forms forum.
Re: an indexing problem! [message #153577 is a reply to message #153529] Tue, 03 January 2006 04:04 Go to previous messageGo to next message
oraclekid
Messages: 5
Registered: January 2006
Location: Pakistan
Junior Member
Well, i am making a "Document Archival System", which involves searching, indexing and displaying.

And i am facing two problems, if either of them is solved, the other would be solved also.
Re: an indexing problem! [message #153581 is a reply to message #153577] Tue, 03 January 2006 04:17 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
I am unable to reproduce your problem regarding indexing and searching a pdf file. Perhaps you could attach a copy of a sample pdf file that produces your problem and also provide your table structure. A pdf document cannot be displayed from SQL*Plus and I do not use Forms, but am aware that there are ways of doing so in Forms. There are other experts, such as D. Martin who browse the Forms forum and can help you that. I have demonstrated below a test of storage, indexing, and searching, as close as I can to what I understand you are trying to do.

scott@ORA92> CREATE TABLE dummy_blob
  2    (id	   NUMBER,
  3  	attachment BLOB,
  4  	CONSTRAINT dummy_blob_pk PRIMARY KEY (id))
  5  /

Table created.

scott@ORA92> CREATE OR REPLACE DIRECTORY my_files AS 'c:\oracle'
  2  /

Directory created.

scott@ORA92> DECLARE
  2    v_blob  BLOB;
  3    v_bfile BFILE;
  4  BEGIN
  5    INSERT INTO dummy_blob (id, attachment)
  6    VALUES (1, EMPTY_BLOB())
  7    RETURNING attachment INTO v_blob;
  8    v_bfile := BFILENAME ('MY_FILES', 'master~1.pdf');
  9    DBMS_LOB.FILEOPEN (v_bfile);
 10    DBMS_LOB.LOADFROMFILE (v_blob, v_bfile, DBMS_LOB.GETLENGTH (v_bfile));
 11    DBMS_LOB.FILECLOSE (v_bfile);
 12  END;
 13  /

PL/SQL procedure successfully completed.

scott@ORA92> Create index mytable_index
  2  on dummy_blob(attachment)
  3  indextype is ctxsys.context
  4  PARAMETERS ('FILTER CTXSYS.INSO_FILTER')
  5  /

Index created.

scott@ORA92> select token_text from dr$mytable_index$i
  2  /

TOKEN_TEXT
----------------------------------------------------------------
0
1
10
131MG
2
27G
3
342MG
34G
350
39G
4
4G
5
58.6
592
6
8
ADD
ADDED
ALONG
ANGOSTURA
ANNE
AROMATIC
BAKE
BAKING
BEEF
BELL
BITTERS
BOIL
BOILING
CALORIES
CARBOHYDRATE
CHEDDAR
CHEESE
CHOLESTEROL
CHOPPED
COMBINES
COOKED
COOL
CUPS
DEEP
DEGREE
DICED
DIETARY
DIFFERENT
DISTINCTIVE
DRAIN
DROP
ESPECIALLY
EXCHANGES
EXCLUDING
FAT
FIBER
GRAIN
GROUND
HEATED
HERBS
HOUR
HOURS
INCH
INSTEAD
INVERT
ITEMS
JO
LARGE
LEAN
LESS
MEAT
MEATS
MERRILL
MILK
MINUTES
MIX
MIXTURE
NON
NOTE
OMIT
ONION
OPTIONAL
OUNCES
OVEN
PAN
PEPPER
PEPPERS
PER
PLACE
PORK
POT
POTATO
POTATOES
POUND
PREFER
PREHEATED
PREPARATION
PROTEIN
REMOVE
RICE
SALT
SAUCE
SEASON
SEE
SEEDS
SERVE
SERVING
SERVINGS
SHALLOW
SHREDDED
SLICE
SODIUM
STARCH
STUFF
STUFFED
TASTE
TEASPOONS
TIME
TOGETHER
TOMATO
TOP
UNKNOWN
UNTIL
USE
USUAL
VEGETABLE
VEGETABLES
VERSION
WATER
YOU

128 rows selected.

scott@ORA92> SELECT id
  2  FROM   dummy_blob
  3  WHERE  CONTAINS (attachment, 'VEGETABLE') > 0
  4  /

        ID
----------
         1

scott@ORA92> 

Re: an indexing problem! [message #153583 is a reply to message #153577] Tue, 03 January 2006 04:24 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9097
Registered: November 2002
Location: California, USA
Senior Member
What version of Oracle are you using and what program and version are the source of your pdf files? You may need to use a different filter, such as auto_filter. By the way, I will be logging off soon, as if is 2:23 a.m. here.


Re: an indexing problem! [message #153590 is a reply to message #153529] Tue, 03 January 2006 04:43 Go to previous message
oraclekid
Messages: 5
Registered: January 2006
Location: Pakistan
Junior Member
Well, following is the table structure.

SQL> desc dummy_blob;
Name Null? Type
----------------------------------------- -------- ------------
ID NUMBER
DOCUMENTS BLOB


In the "DOCUMENTS" column, i have some "DOC" and "PDF" files. And my question is, how can i display these "PDF" files on a Form? I am using Forms 6i, and i use Adobe Acrobat 7.0. This is the first problem.

The second problem i face, is that, all works fine, when i do indexing the way you did. The problem arises, when i try to insert the PDF files in the database through an OLE container in a form. You inserted the PDF file in the databse through a PL/SQL procedure. What i have concluded is that, when i insert the PDF file through an OLE container in the database, the OLE saves the file in a wrapper. That wrapper contains information, like, 'author name, file type' etc. Then when i create an index in SQL Plus, the way you did,

select token_text from dr$mytable_index$i

the above returns all sorts of garbage values. It also returns the contents of the PDF but also displays the contents of the wrapper. But when i insert the PDF into the database through SQL Plus, the file is itself inserted in the database without any wrapper. And then the indexing works fine, like it did at your end. I hope you understand my problem. Thanks a ton for your patience and time ..

So, my problem would be solved, if i can get the solution of any of the above problems. And the difference between what you did, and what i am doing is, I insert the PDF file in the database through an OLE container in the form, while you did that through a PL/SQL procedure ..

[Updated on: Tue, 03 January 2006 04:49]

Report message to a moderator

Previous Topic: Hi I'm new to Oracle family
Next Topic: Forms-Reports Background Engine Errorstring
Goto Forum:
  


Current Time: Fri Sep 20 05:25:56 CDT 2024