Search for "related documents" as Altavista or Google do it? - Multimedia (formerly interMedia)(Archived)(Archived)

Hi,
does Intermedia Text support the search for a document that is similar to another one, which I have just found? Altavista and Google support this feature.
Can it be implemented using Intermedia Text (8.1.7 and above)?
Best regards,
~dietmar aust.

You can implement a more like this function using ctx_doc.themes.
The function works the following way: given a record (index name
and primary key), creates a theme search using the top n themes.
You can call it from the sql statment:
select * from mytable where contains(text, moreLikeThis(indexname, pk, n)) > 0
-- where n is the number of themes.

Related

Full text xquery can return a score using ora:contains? (Jdev 11.1.1.4)

Hello to all,
I'm using this query for selecting document object:
select d.* from document d WHERE d.XML.existsNode('//field[ora:contains(#value,"preview","ai_my_policy") and #searchable="true"]', 'xmlns:ora="http://xmlns.oracle.com/xdb"') = 1
where ai_my_policyis to have diacritics insensitive, and "preview" is the searched therm. It works perfectly, but now I'd like to have a relevance value.
For instance: if I search "preview rome" I want all document that contains one or both therms.
+select d.* from document d WHERE d.XML.existsNode('//field[(ora:contains(#value,"preview","ai_my_policy") or ora:contains(#value,"rome","ai_my_policy")) and #searchable="true"]', 'xmlns:ora="http://xmlns.oracle.com/xdb"') = 1+
But I'd like to assigne a score to result.
For exmaple if a document contains both words the score is 2 if it contains only one word the score is 1.
Is it possible?
In the [Full-Text Search Over XML|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb09sea.htm] documentation it seems that I can use the core function only on contains function, and not on ora:contains (that I need for using ai_my_policy)...
Any suggestion?
Cristian

oracle text for varchar2

Hi ...
can i use oracle Text for searching in varchar2 field ....
IF yes , plz give me the details ....
Thanks .... 
can i use oracle Text for searching in varchar2 field
....
IF yes , plz give me the details ....Of course you can. You would need to either create a context index and search using the contains operator or create a ctxcat index and search using the catsearch operator. There are plenty of examples on this forum and in the Oracle Text Reference and Oracle Text Application Developer's Guide in the online documentation. 
In case I use CTXCAT, is there any means to track the score of every hit I receive? As I will be using fuzzy matches passed to the string.
Thanks. 
I use a stored proc that has the following:
SELECT OD OID, TAB Layer, COLUM Field, TEX Result, score(22) Score FROM VIEW_MASTER
WHERE CONTAINS ( TEXT_VALUE, SEARCH_TERMS, 22 ) > 0 ORDER BY Score;
The search_terms are an inbound parameter. Not sure what the 22 does, i think its just an alias name. I don't know what the score coming back means. Sometimes I get 16, sometimes 12, sometimes 7.
I could use some help on this myself. 
In case I use CTXCAT, is there any means to track the
score of every hit I receive? Unfortunately, CTXCAT indextype does not support scoring.
Faisal 
SELECT OD OID, TAB Layer, COLUM Field, TEX Result,
score(22) Score FROM VIEW_MASTER
WHERE CONTAINS ( TEXT_VALUE, SEARCH_TERMS, 22 ) > 0
ORDER BY Score;
The search_terms are an inbound parameter. Not sure
what the 22 does, i think its just an alias name. I
don't know what the score coming back means.
Sometimes I get 16, sometimes 12, sometimes 7.
I could use some help on this myself.Yes, 22 is just an alias. You can use any number here since it is just a label which is used to correlate the CONTAINS function with its corresponding SCORE function.
The details of how the score is computed are available in the Oracle Text Reference book, Appendix "F The Oracle Text Scoring Algorithm".
Faisal

XML context search with escape characters

Hi,
I have a piece of XML in an XMLTYPE column which is context indexed. The xml looks like
<content>
<EndDate/>
<Councillor>Smith John</Councillor>
<Committee>Inspection Leader&#039;s Advisory Body </Committee>
<StartDate/>
<LinkType>Committee Link</LinkType>
<Text/>
</content>
My query which escapes the search field between {} is
select xmlType.getStringVal(xmlType.extract(CI.CONTENT_XML,'/content/Committee/text()')) Committee
from CMPS.CM$CONTENT_ITEMS CI
where CONTAINS(content_xml,'{Inspection&a} INPATH(/content/Committee)') > 0
returns the row successfully
However
select xmlType.getStringVal(xmlType.extract(CI.CONTENT_XML,'/content/Committee/text()')) Committee
from CMPS.CM$CONTENT_ITEMS CI
where CONTAINS(content_xml,'{Inspection&am} INPATH(/content/Committee)') > 0
--Note the extra character in between {}
does not return anything.
Can someone tell me if I am escaping the reserved characters correctly?
Is there something that I missed when I created my index i.e
CREATE INDEX CIM_CONTEXT ON
cm$content_items(content_xml) indextype is ctxsys.context;
I am running 9.2.0.4 on RED HAT 3.
Thanks
Joel. 
Since you question pertains to use of INPATH which [art of Oracle Text, rather than XML DB you would probably be better off posting in the Oracle Text Forum. I'll ask the text expert to take a look at this one...
                                                                                                                                                                                                                                                                                                                                                                                                                                            
Mark,
Thanks for chasing. I have also posted this on the Oracle Text forum but have had little response.
Regards
Joel. 
From the text team...
The default section group for XMLType column is path section group.
As for his question, the reason why he gets a hit for the first query:
{Inspection&a} INPATH(/content/Committee), is because {Inspenction&a} is lexed as
a phrase "Inspection a" and a by default is 'a' stop word.
And {Inspection&am} is lexed as a phrase "Inspection am". Since there is no such phrase ("am" is not a stop word), the query does not return the row.
If he tries {Inspection&an}, he will get the row because "an" is again by default a stop word.
The behavior is independent of INPATH operator. He will see the same behavior without INPATH operator:
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&a}') > 0;
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&am}') > 0;
select * from CMPS.CM$CONTENT_ITEMS CI where CONTAINS(content_xml,'{Inspection&an}') > 0;
Note sure I understand it but I hope it helps

XPath and Intermedia ?

Hello,
isnt it possible to search nodes with xpathes ?
Example :
Assume the following xml is stored in an intermedia indexed clob column named text of a table named books :
<author>
<first_name>Stephen</first_name>
<last_name>King</last_name>
</author>
I tried this statement
select count(1) from books where contains(text, 'King wihtin //author/last_name') > 0;
, but had no success.
The problem is, that there might be other "last_name"-nodes in other contextes. But i must ensure that i get a authors last_name...
Any solvation without changing the xml-structure or datamodel ??
thanks.
:) Thomas
null 
XPath-like support is available in 9i. Please check the 9i technical overview at technet.oracle.com/products/text

Search for string

I would like to have a search capability so that I can have a string of any type and search for it within a field in a table. Basically like the find feature in MS Word or notepad.
What function would I use to accomplish this? Thanks. 
 <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mark (mark.ducharme#transpo.ottawa.on.ca):
I would like to have a search capability so that I can have a string of any type and search for it within a field in a table. Basically like the find feature in MS Word or notepad.
What function would I use to accomplish this? Thanks.<HR></BLOCKQUOTE>
try :
select * from <your_table> where <your_filed> like '%<you_string>%';
This will get you all records containing your string in specified field.
If you want a case UNsensitive search :
select * from <your_table> where UPPER(<your_filed>) like '%'| |UPPER(<you_string>)| |'%'; 
Use the INSTR function:
Select INSTR (field, string_to_find)
From Table
Which will return 0 if it does not find string_to_find, otherwise it returns the position at which string_to_find occurs in field.
null 
Hi the above two options are good, and You can even use soundex function for this functionality.
Cheers
null

Categories

Resources