Highlighting a keyword in Oracle Text
Hi
I am trying to highlight the query terms returned as part of the result set from Oracle text. Although I know this is possible, I am unsure as to exactly how to achieve it. Please guide me.
Thanks
AJ
You can use ctx_doc.markup or ctx_doc.snippet. You can find the syntax and examples in the online documentation. There are also some examples on this forum.
Similar Messages
-
Search with % in oracle text
How can i retrieve the records which has "80%" "and" keyword using oracle text . Because oracle consider " % , and , or " as the stopwords ... But i want to do the search on "80%" not "80" how to do that ....
below query retrieving both "80" and "80%" records....but i want only "80%"
SELECT ID, AUTHOR, DOCUMENT, PATH, PATH1
FROM DATASTORES_TAB a
WHERE contains ( dummy_col,'{80%}' ) > 0;Try this...
exec ctx_ddl.drop_preference('my_basic_lexer')
BEGIN
ctx_ddl.create_preference
preference_name => 'my_basic_lexer',
object_name => 'basic_lexer'
ctx_ddl.set_attribute
preference_name => 'my_basic_lexer',
attribute_name => 'printjoins',
attribute_value => '_%'
END;
drop table t1;
create table t1 (text varchar2(80));
insert into t1 values ('My example is 80% complete');
insert into t1 values ('This contains 80 without percent');
insert into t1 values ('This contains 801 without percent');
insert into t1 values ('Na%me1');
insert into t1 values ('Narme1');
CREATE INDEX t1_index ON t1 ( text )
indextype IS ctxsys.context
parameters ( 'lexer my_basic_lexer' );
select text from t1 where contains (text, '80%') > 0;
select text from t1 where contains (text, 'Na%me1') > 0;
select text from t1 where contains (text, '{80%}') > 0;
select text from t1 where contains (text, '{Na%me1}') > 0;
Output:
SQL> select text from t1 where contains (text, '80%') > 0;
TEXT
My example is 80% complete
This contains 80 without percent
This contains 801 without percent
Elapsed: 00:00:00.01
SQL> select text from t1 where contains (text, 'Na%me1') > 0;
TEXT
Na%me1
Narme1
Elapsed: 00:00:00.01
SQL> select text from t1 where contains (text, '{80%}') > 0;
TEXT
My example is 80% complete
Elapsed: 00:00:00.00
SQL> select text from t1 where contains (text, '{Na%me1}') > 0;
TEXT
Na%me1 -
Error When Creating Oracle Text index using Lexer Keyword
Hi All,
I am getting following error when i creating oracle text index using lexer & stoplist keyword.
Pls Help me if any body know.
Thanks in Advance.
Error starting at line 1 in command:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
Error at Command Line:1 Column:13
Error report:
SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-11000: invalid keyword LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
*Cause: Failed to successfully execute the ODCIIndexCreate routine.
*Action: Check to see if the routine has been coded correctly.
Regards,
Jack R.Hi,
it works if you put an extra PARAMETERS clause at the end so the creation looks like:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
Hope this helps
Herald ten Dam -
Oracle iRecruitment: Keyword Search within Resumes using Oracle Text
Dear All,
As per my understanding (and Note: 247064.1) simple Keyword searches can be performed in iRecruitment if oracle Text is installed. However searching for Keywords within resumes is not possible using Oracle Text and is possible ONLY if Resume Parsing is enabled via a third party (non-oracle) service provider.
Can you please let me know if my understanding is correct and if not provide further inputs on this.
Thanks,
SubratGot this confirmation from Oracle via SR:
Resume searching is independent of resume parsing and not required to search resumes.
Oracle Text is the text engine that allows you to search documents using content-based queries. Oracle Text allows you to upload documents, search documents, parse resumes, etc.
Hence to conclude - Installation of Oracle Text will allow Keyword Searches on resumes.
Thanks,
Subrat -
Highlighting results using oracle text
Hi
I've hooked up to Oracle text using odp.net and can query that fine. Now I would like to use the highlighting feature of OT but I'm having problems finding suitable examples of how to do it.
I've read through a number of Oracle Text documents, they say use CTX_DOC package to hightlight the result but that's PL/SQL. How can I do it with odp.net ?
thanksOk thanks for that - I've done that and its cleared the error but I'm still finding more problems
i've tweaked my code some more as the one and currently have this
setType();
OracleConnection oConn= dbConnect();
//setType();
oConn.Open();
OracleCommand oCmd = new OracleCommand();
oCmd.CommandText = "ctx_doc.Highlight";
oCmd.Connection = oConn;
oCmd.CommandType=CommandType.StoredProcedure;
//params
OracleParameter oparam2 = oCmd.Parameters.Add("index_name", OracleDbType.Varchar2);
oparam2.Direction = ParameterDirection.Input;
oparam2.Value = "description_idx";
OracleParameter oparam3 = oCmd.Parameters.Add("textkey", OracleDbType.Varchar2);
oparam3.Direction = ParameterDirection.Input;
oparam3.Value = "ID";
OracleParameter oparam4 = oCmd.Parameters.Add("text_query", OracleDbType.Varchar2);
oparam4.Direction = ParameterDirection.Input;
oparam4.Value = "test || hello";
OracleParameter oparam = oCmd.Parameters.Add("restab", OracleDbType.Varchar2);
oparam.Value = "ctx_hitab";
oparam.Direction = ParameterDirection.Input;
OracleParameter oparam5 = oCmd.Parameters.Add("plaintext", OracleDbType.Int32);
oparam5.Direction = ParameterDirection.Input;
oparam5.Value = false;
OracleDataAdapter da = new OracleDataAdapter(oCmd);
DataSet ds = new DataSet();
da.Fill(ds,"TEST");
//oCmd.ExecuteNonQuery();
oConn.Close();
and it's producing this error which obviously relates to parameter 3 but I'm not sure how I can correct it.
ORA-20000: Oracle Text error: DRG-11445: rowid value is invalid: ID ORA-06512:
at "CTXSYS.DRUE", line 157 ORA-06512: at "CTXSYS.CTX_DOC", line 876 ORA-06512: at
line 1
many thanks -
Hi!!
I followed the steps described in the reference guide of Oracle Text to highlights the result of a search in a text, but I can't show the text whit these words highlighting.
I copy the code I ran:
create table hightab(query_id number,
offset number,
length number);
Table created
begin
ctx_doc.highlight('sentencias', '4', 'redactor', 'hightab', 0, TRUE);
end;
PL/SQL procedure successfully completed
select * from hightab
QUERY_ID OFFSET LENGTH
0 89 8
Thanks a lot!
Regards,
Fabiana.It works for me, so in must be due to some differences in settings.
scott@ORA92> CREATE TABLE sentencias_ws
2 (id NUMBER PRIMARY KEY,
3 doc XMLTYPE)
4 /
Table created.
scott@ORA92> INSERT INTO sentencias_ws VALUES
2 (189, XMLTYPE ('<EST>
3 <JUR>
4 <SENT>
5 <NUMERO>2/04</NUMERO>
6 </SENT>
7 </JUR>
8 <NUMERO>1/2005</NUMERO>
9 </EST>
10 '))
11 /
1 row created.
scott@ORA92> begin
2 ctx_ddl.create_section_group('XMLGroup', 'XML_SECTION_GROUP');
3 ctx_ddl.ADD_ZONE_SECTION( 'XMLGroup', 'EST', 'EST' );
4 ctx_ddl.ADD_ZONE_SECTION('XMLGroup', 'JUR', 'JUR' );
5 ctx_ddl.ADD_ZONE_SECTION( 'XMLGroup', 'SENT', 'SENT' );
6 ctx_ddl.ADD_ZONE_SECTION( 'XMLGroup', 'NUMERO', 'NUMERO' );
7 end;
8 /
PL/SQL procedure successfully completed.
scott@ORA92> begin
2 ctx_ddl.create_preference('MYLEX','BASIC_LEXER');
3 ctx_ddl.set_attribute('MYLEX','SKIPJOINS','.');
4 ctx_ddl.set_attribute('MYLEX','NUMJOIN',',');
5 end;
6 /
PL/SQL procedure successfully completed.
scott@ORA92> CREATE INDEX busquedaXML ON sentencias_ws(doc)
2 INDEXTYPE IS ctxsys.context
3 PARAMETERS
4 ('datastore ctxsys.default_datastore
5 filter ctxsys.null_filter
6 section group XMLGroup
7 lexer mylex')
8 /
Index created.
scott@ORA92> Select * from sentencias_ws
2 where contains(doc, '(((2/04 within NUMERO) WITHIN SENT) WITHIN JUR) WITHIN EST')>0
3 /
ID
DOC
189
<EST>
<JUR>
<SENT>
<NUMERO>2/04</NUMERO>
</SENT>
</JUR>
<NUMERO>1/2005</NUMERO>
</EST>
scott@ORA92> -
Error When Creating OR Rebuilding Oracle Text index using Lexer Keyword
Hi All,
I am getting following error when i creating oracle text index using lexer & stoplist keyword.
Pls Help me if any body know.
Thanks in Advance.
Error starting at line 1 in command:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
Post INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
Error at Command Line:1 Column:13
Error report:
SQL Error: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-11000: invalid keyword LEXER
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 365
29855. 00000 - "error occurred in the execution of ODCIINDEXCREATE routine"
*Cause: Failed to successfully execute the ODCIIndexCreate routine.
*Action: Check to see if the routine has been coded correctly.
Regards,
Jack R.Hi,
it works if you put an extra PARAMETERS clause at the end so the creation looks like:
CREATE INDEX TXT_INX_TEXT_SEARCH ON TEXT_SEARCH (BFILE_DOC)
INDEXTYPE IS "CTXSYS"."CONTEXT" LOCAL (
PARTITION "BEFORE_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') ,
PARTITION "Q1_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2007" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2008" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q1_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q2_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q3_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "Q4_2009" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)'),
PARTITION "THE_REST" PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)')
PARAMETERS ('LEXER dd_lexer STOPLIST dd_stoplist SYNC (ON COMMIT)') <== Added
Hope this helps
Herald ten Dam -
Document management system using oracle text
i plan to create document management system using oracle text with following features
1) document comparision
2) document search
and more...
can oracle text be used to display documents of various formats by converting them to HTML. and can search keywords be highlighted in the document.
please help!Have you ever considered doing this in Oracle Application Express (free on top of the Oracle database)? How about something like:
http://download-west.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm
Index the files using the CONTEXT index, and perhaps the docs' meta with it using the Oracle Text MULTI_COLUMN_DATASTORE, and then when you write your query for a report on the documents include a search string.
I've created a number of APEX-based document management systems and it is quite easy once you get the hang of using this environment. I suggest looking at some of the tutorials/how-to documents and you'll be on your way quickly.
Start with the upload application. Once you can get your documents in, create a report that shows everything except the document. Verify all of this works correctly.
Add some "items" to the page for the report, and include them as bind variables in the where clause.
After that, add your Oracle Text index to the database, and toss in a "text-field" item to the APEX page. Modify your report query, adding the CONTAINS clause, and use the newly created item as a bind variable. There's your keyword search.
Linking to Oracle Apps is done through API's and may be over database links.
Hope it helps. Though not a step-by-step how to document, this should point you in the right direction. Get familiar with APEX as that covers most of what you described.
-Ron -
Hi,
from what I've read about it, the following has to be done.
e.g. CREATE index ticket_keywords_index ON ticket(keywords) indextype IS ctxsys.context;
CREATE index ticket_solution_index ON ticket(solution) indextype IS ctxsys.context;
SELECT * from ticket where ctxsys.contain(:P12Value_to_find);
But I wonder, how does it know on which index it has to look ?
Is there anyway to specify on what it should look ?
If yes, any idea how one goes on about that ?
If no, any idea how to avoid getting information from the two columns back, if one only needs one ?
Could it in a way be done, by adding a column in apex, that allows to put in a checkbox, at the top, to say include this column in the search, or not, or is this not the good way to do so ?
Or am i missing a point ?
Thanks for the help,
FlorisFloris,
Your query should be of the form:
SELECT *
FROM ticket
WHERE contains(indexed_col,:P12_VALUE_TO_FIND) > 0Where indexed_col is the name of the column on which you have built your Oracle Text index and :P12_VALUE_TO_FIND is the page item that contains the Search String.
Andy
http://atulley.wordpress.com/ -
Using oracle text in apex report search
I am trying to use oracle text in apex, integrating it in an existing application. The idea is that it will allow to do a search in bigger textfields. Thats how I want it to get to work. In one of the oracle packaged applications oracle text is used as well, so I will have a look to that as well. I've addapted this search. I've added
AND t. contains(oplossing, :P15_OPLOSSING)
AND t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)
That didn't work, so I changed those two to:
AND t.oplossing = (t.contains(oplossing, :P15_OPLOSSING)>0)
AND t.sleutelwoorden = (t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)>0)
which didn't work either, which I expected to be the case. Clearly I'm not doing it correctly, I intend to look it up tonight in the packaged applications as I do want to findt it myself to.
But does anyone can give a hint, on what I am doing wrong ?
SELECT t.ticketid ticketnr, t.ticketid,
g.voornaam||' '||g.naam aangemaaktdoor,
t.credt, t.applicatiecd, t.titel,
s.statusdefoms,
si.statusdefoms instat,
NVL2(t.toegekend,'Y','N') toegekend,
sleutelwoorden, klantprioriteitid, oplossing, s.htmlkleur, si.htmlkleur inthtmlkleur
FROM ticket t,
gebruiker g,
status s,
status si
WHERE t.gebruikerid = g.gebruikerid
AND t.statusid = s.statusid
AND t.statusinternid = si.statusid (+)
AND t.applicatiecd = NVL(:P0_APPLICATIECD, :F101_APPLICATIECD)
AND (t.categorieid = :P15_CATEGORIEID OR NVL(:P15_CATEGORIEID, 0) = 0)
AND (t.moduleid = :P15_MODULEID OR NVL(:P15_MODULEID, 0) = 0)
AND (t.statusid = :P15_STATUSID OR NVL(:P15_STATUSID, 0) = 0)
AND (t.statusinternid = :P15_INTSTATUSID OR NVL(:P15_INTSTATUSID, 0) = 0)
AND (t.versieid = :P15_VERSIEID OR NVL(:P15_VERSIEID, 0) = 0)
AND t.ticketid LIKE '%'||:P15_TICKETID||'%'
AND t.gebruikerid = DECODE(NVL(:P15_GEBRUIKERID,0), 0, t.gebruikerid, :P15_GEBRUIKERID)
AND t.credt BETWEEN NVL(:P15_DATUMVAN, To_Date('01-01-1900', 'DD-MM-YYYY')) AND NVL(To_Date(:P15_DATUMTOT, 'DD-MM-YYYY'), sysdate) +1
AND t.titel LIKE '%'||:P15_TITEL||'%'
AND t. contains(oplossing, :P15_OPLOSSING)
AND t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)
AND PCK$Ticket_Admin.getklantid(t.gebruikerid) = DECODE(Pck$Ticket_Admin.isklantadminroleN(:APP_USER,NVL(:P0_APPLICATIECD, :F101_APPLICATIECD)), 1, PCK$Ticket_Admin.getklantid(:APP103_GEBRUIKERID), PCK$Ticket_Admin.getklantid(t.gebruikerid))
AND (:APP103_GEBRUIKERID IN (t.voor_gebruikerid, t.gebruikerid)
OR Pck$Ticket_Admin.isintern(:APP_USER,:P0_APPLICATIECD) = 1)
changed to:
AND t.oplossing = (t.contains(oplossing, :P15_OPLOSSING)>0)
AND t.sleutelwoorden = (t.contains(sleutelwoorden, :P15_SLEUTELWOORDEN)>0)I have worked it further out now, and looked at the search of the packaged application. It turned out to be a pl/sql block . I used what I found in there to adapt the previous search. I added the following:
OR (CONTAINS(t.oplossing, :P15_OPLOSSING)>0)
OR (CONTAINS(t.sleutelwoorden, :P15_SLEUTELWOORDEN)>0)
OR (CONTAINS(t.titel,:P15_SEARCH_T_O_S)>0 OR
CONTAINS (t.oplossing, :P15_SEARCH_T_O_S)>0 OR
CONTAINS(t.sleutelwoorden, :P15_SEARCH_T_O_S)>0 )
OR (CONTAINS(t.titel,:P15_SEARCH_T_O_S)>0 AND
CONTAINS (t.oplossing, :P15_SEARCH_T_O_S)>0 AND
CONTAINS(t.sleutelwoorden, :P15_SEARCH_T_O_S)>0 )
oplossing means solution
sleutelwoorden means keywords
titel means title
Yet this doesn't work yet. It gives an error message:
failed to parse SQL query:
ORA-01719: outer join operator (+) not allowed in operand of OR or IN
I've tried adding the addition in a different place, yet that gives the same error message. I'm not sure now. -
Can someone point me to some resources on how to integrate Oracle Text and APEX to do searches, highlight results, etc (all the features of Oracle Text)?
The data to be indexed is in files on the filesystem, so I would like to keep it that way and use the FILE_DATASTORE option for Text.
Thanks for any pointers.
Update: Yes, I did see http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
but the search results there just returns the URL/file containing the "hit". It doesn't show the actual text fragment that caused the match, doesn't highlight it, etc. I am looking for a real Google-like search. Hm, having said that, I might as well use Google Desktop! Nah, where's the fun in that?This is a very simple application for my own use. It started life in 8i when there were fewer Text options.
As such, it uses the query string as entered. This returns all of the matches:
select msgid, msgdate, Box, fromaddr, subject
from eudora.inbox
where contains(body, :P703_MailSearch) > 0
order by msgdate descI display the selected result like this:
select subject,
Replace(eudora.mmarkup(:P704_MSGID, :P702_SEARCH), Chr(13), '<BR>') Body
from eudora.inbox
where msgid = :P704_MSGIDIn a newer application, I experimented with the CTXCAT grammer.
That query looks like this:
select m.ID, m.pdpno, m.shortdesc
from pdp_mast m
where contains(m.dphistory, '<query><textquery lang="ENGLISH" grammar="CTXCAT">
' || :P1_Text || '
</textquery>
<score datatype="INTEGER"/>
</query>') > 0
or contains(m.shortdesc, '<query><textquery lang="ENGLISH" grammar="CTXCAT">
' || :P1_Text || '
</textquery>
<score datatype="INTEGER"/>
</query>') > 0As always, once you figure out the syntax, its easy to make it work in Apex.
Text indexes are very fast. On my old 600MHz PC, searches in 250MB of text take less than a second. -
Oracle Text in installing Oracle 10g without licence!!
Hi. Everyone.
I've read some thread , but I am still confused about "oracle text".
Now, I am testing oracle10g database.
I downloaded 10g software from www.oracle.com, and installed it sucessfully
on windows xp.
When I was trying to import a dump file from oracle9i to
the unlicenced oracle10g database, I got the error , IMP-00017, which
is related to "Oracle Text".
I checked "dba_users" dictionary, but ctxsys user is locked and expired.
I read some thread on this site, and according to the advice, I tried to
enable oracle text, using "DBCA".
However, every database option on DBCA is disabled, I was not able to
check oracle text.
Lastly, how can I enable "Oracle Text" with unlicenced oracle 10g ?
Is this possible without licence?
I am very confused about this.
I am looking forward to hear your experience and advices.
Have a nice day.
Best Regards.
Ho.Well, instead of being confused, you could go to http://www.oracle.com/pls/db102/portal.portal_db?selected=1 and look at
1) the licensing document, which would tell you whether you need a separate license, and
2) under the 'Books' tab, look at the Text Application Developer's Guide or the Text Reference manuals for details.
You could also look for the Oracle Text forum (from the http://forums.oracle.com page, under Database - More, or Text and ask the people who concentrate on that set of features.
In general, Oracle Text is a set of extensions, the definitions for which are stored under user ctxsys. You would use these extensions by creating your own objects that are based on the extensions.
For example, suppose your tables contain varchar2 columns. Create indexes that are based on ctxsys's 'context index type' and your application can then use the 'CONTAINS' keyword search capability (which is effectively a ctxsys-owned extension to the select)
However, you would never log on to ctxsys and do anythibng with that as you risk changing the template code that Oracle has supplied.
Message was edited by:
Hans Forbrich
PS: Yes, Oracle Text is included as part of the base database. Most of it is even included in the free Oracle XE database. -
Highlite oracle text search terms
I have a report that I set up using the instructions for Oracle Text Application in APEX. It works very well however I have the actual document as a link and I would like the search terms highlighted in the actual document. Is there a way to do that in APEX?
I use this Region Source:
select score(1) relevance, filename, dbms_lob.getlength("DOCUMENT") Document, code_id
from documents
where contains (document, :P10_SEARCH, 1) > 0
order by 1 desc
I read something about using ctx_doc.snippet to highlight but can get that to work.
Any suggestions or can APEX highlight terms when the actual document is used?'8265490,
Take a look at the ctx_doc.markup procedure. I think it will do what you want.
http://download.oracle.com/docs/cd/B19306_01/text.102/b14217/view.htm#sthref599
My home server is on a moving truck, so I can only point you to some old forum posts for examples:
Re: Using Oracle Text with Apex
Re: Use apex to display email
Doug -
hi,
we have implemented oracle text search. When trying to search a keyword contains in Adobe Reader 7.0 pdf version no search result is showing while the same keyword search is showing the pdf file which is in Adobe Reader 6.0.
Can any one please help with the way out?
Oracle Version:Oracle10g(Release 2)
//sabyusually this sort of thing occurs when the filters that you are using predate the release of acrobat involved. I don't know for sure the dates on your particular versions - and indeed you don't give us the db patch level - but a metalink search should reveal this.
Niall Litchfield -
Dear Professionals,
I am using oracle text functionality(11g).
Is there any way to replace '-' with space and search the as full text as '18005-12220',or partial(either 18005 or 12220 ) as keyword.
case 1)
select * from search_table where CONTAINS(searchdata,'18005\-12220')>0;
o/p=>18005-12220 xyz abc address 145
case 2)
select * from search_table where CONTAINS(searchdata,'18005')>0;
o/p=>no rows
case 3)
select * from search_table where CONTAINS(searchdata,'12220')>0;
o/p=>no rows
BEGIN
ctx_ddl.create_preference ('SUBSTRING_PREF', 'BASIC_WORDLIST');
ctx_ddl.set_attribute ('SUBSTRING_PREF', 'substring_index', 'YES');
ctx_ddl.set_attribute ('SUBSTRING_PREF', 'prefix_index', 'YES');
ctx_ddl.set_attribute ('SUBSTRING_PREF', 'prefix_min_length', 1);
ctx_ddl.set_attribute ('SUBSTRING_PREF', 'prefix_max_length', 10);
ctx_ddl.set_attribute ('SUBSTRING_PREF', 'WILDCARD_MAXTERMS', 10000);
ctx_ddl.create_preference('mylex', 'BASIC_LEXER');
ctx_ddl.set_attribute('mylex', 'printjoins', '_-');
Ctx_Ddl.Set_Attribute ( 'mylex', 'index_themes', 'FALSE');
Ctx_Ddl.Create_Preference('my_text_storage', 'BASIC_STORAGE');
ctx_ddl.set_attribute('my_text_storage','I_TABLE_CLAUSE', 'tablespace users storage (initial 10M next 10M)');
ctx_ddl.set_attribute('my_text_storage', 'K_TABLE_CLAUSE', 'tablespace users storage (initial 10M next 10M)');
ctx_ddl.set_attribute('my_text_storage', 'R_TABLE_CLAUSE', 'tablespace users storage (initial 10M) lob (data) store as (cache)');
ctx_ddl.set_attribute('my_text_storage', 'N_TABLE_CLAUSE', 'tablespace users storage (initial 1M)');
ctx_ddl.set_attribute('my_text_storage', 'I_INDEX_CLAUSE', 'tablespace users storage (initial 1M) compress 2');
ctx_ddl.set_attribute('my_text_storage', 'P_TABLE_CLAUSE', 'tablespace users storage (initial 1M)');
END;thanks Roger Ford for your valuable suggestion.problem is resolved now.
Maybe you are looking for
-
Kernel panics on my mac pro for almost a year- I am at my wit's end
So I have a mid 2010 Mac Pro. 12 Core, initially 16GB of Ram (Recently upgraded to 24GB of RAM). Starting in January of 2012 my machine running Snow Leopard started to go to sleep and not wake up. This would happen every few days but then would in
-
Adobe acrobat 9 pro not displaying jpegs on ipad/ ipod touch
Hello, I am sure that this question came up in the pass. After using the "Document" , "Reduce file size" say to be compatible with Acrobat 8 then jpg are not showing on ipad/ touch. Has anybody experience this? Thank you in advance Carlos
-
Bootcamp windows xp time sync.
I'm behind a corporate firewall. i tried editing the registry with the universal time and still the time advances like 4 hrs ahead after a few hrs of using the mac. anybody resolved the problem?
-
In case of service Purchase Orders we can give service reference in text column in the item-level tab of PO. Again we assign different service masters in the service tab of PO. Our clients requirement is that for one purchase order, it should allow
-
Double conditions to hide/display a field
Hello all, I have two drop-down menus and a field. In this field, depending on what is selected in both drop-down menus, either a Yes-No choice or a drop-down menu appears. My problem is that I don't know how to do that. Could I run a script on the p