Ctxrule - match does not return expected result

v.11.1.07 - I have created a ctxrule index as detailed below. However, although a query should match on the given document, it does not return. Any ideas?
begin
ctx_ddl.create_preference('ot_lexer', 'basic_lexer');
ctx_ddl.set_attribute('ot_lexer', 'index_stems', 'ENGLOSH');
end;
begin
ctx_ddl.create_section_group('ot_sec_group', 'auto_section_group');
end;
create table ot_profile_test
(profile_id number,
query clob);
create index ot_profile_rule_ndx on ot_profile_test(query)
indextype is ctxsys.ctxrule parameters
('stoplist ctxsys.empty_stoplist
section group ot_sec_group
lexer ot_lexer');
insert into ot_profile_test values(1, '($apple and $pear) and (1 within food)');
commit;
exec ctxsys.ctx_adm.set_parameter('log_directory', '/yourdir');
exec ctx_output.start_log('ot');
exec ctx_output.add_event(ctx_output.event_index_print_rowid);
exec ctx_output.add_event(ctx_output.event_index_print_token);
exec ctx_ddl.sync_index('ot_profile_rule_ndx', '2040M', null, 1, null, ctx_ddl.lock_nowait_error);
exec ctx_output.end_log;Then, run a query:
declare
a clob := 'apple orange pears banana
<metadata>
<indicators>
   <food>1</food>
</indicators>
</metadata>
vn_profile_id number;
begin
select profile_id into vn_profile_id
from ot_profile_test
where matches(query, a) > 0;
dbms_output.put_line(vn_profile_id);
end;
ERROR at line 1:
ORA-01403: no data found
ORA-06512: at line 8Shouldn't profile_id = 1 be returned?
Also, shouldn't the logfile have 2 rows written to $I?
WRITING TOKEN APPLE:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0
WRITING TOKEN APPLES:((PEAR) = (PEARS)) * ((1) WITHIN FOOD),0

You need to use a basic_wordlist instead of a basic_lexer and ENGLISH instead of ENGLOSH in order to use stemming and your clob (variable a) must be valid html or xml in order to search within sections. Please see the simplified demonstration below.
SCOTT@orcl_11gR2> begin
  2    ctx_ddl.create_preference ('ot_wordlist', 'basic_wordlist');
  3    ctx_ddl.set_attribute ('ot_wordlist', 'stemmer', 'ENGLISH');
  4    ctx_ddl.create_section_group ('ot_sec_group', 'auto_section_group');
  5  end;
  6  /
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> create table ot_profile_test
  2    (profile_id  number,
  3       query         clob)
  4  /
Table created.
SCOTT@orcl_11gR2> create index ot_profile_rule_ndx
  2  on ot_profile_test (query)
  3  indextype is ctxsys.ctxrule
  4  parameters
  5    ('stoplist     ctxsys.empty_stoplist
  6        wordlist     ot_wordlist
  7        section group     ot_sec_group')
  8  /
Index created.
SCOTT@orcl_11gR2> insert into ot_profile_test values
  2    (1, '($apple and $pear) and (1 within food)')
  3  /
1 row created.
SCOTT@orcl_11gR2> commit
  2  /
Commit complete.
SCOTT@orcl_11gR2> exec ctx_ddl.sync_index ('ot_profile_rule_ndx')
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> declare
  2    a clob :=
  3        '<table>
  4           <fruits>apple orange pears banana</fruits>
  5           <metadata>
  6             <indicators>
  7            <food>1</food>
  8             </indicators>
  9           </metadata>
10         </table>';
11  begin
12    for r in
13        (select profile_id
14         from      ot_profile_test
15         where  matches (query, a) > 0
16         order  by profile_id)
17    loop
18        dbms_output.put_line (r.profile_id);
19    end loop;
20  end;
21  /
1
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2>

Similar Messages

  • BAPI_ALM_ORDERHEAD_GET_LIST by CREATE_DATE does not return expected result.

    Hi,
    I am trying to retrieve an Order I have manually created on an ECC6.0 system with Order ID 816149.
    I can retrive the order fine using BAPI_ALM_ORDER_GET_DETAIL passig in the Order ID.
    However, if I use BAPI_ALM_ORDERHEAD_GET_LIST with IT_RANGE set on the ENTER_DATE criteria, I get a bunch of Orders back from the search but not mine. However, the creation date of my Order is within the search range. I suspect the problem might be the System Status of my order (but I am just guessing) which is CRTD MANC NMAT NTUP. The User Status is CRTD though, so I am a bit puzzled as to why my order is not in the returned result set. For instance Order 816148 (created by someone else) is returned and it looks very similar to mine (except for the status).
    If any help from SAP people, I am using an ICC Test system so maybe you can have a look for yourself. My system is CF5 / cpcf501 / 05 client 800.
    Cheers.
    JR

    Please pass
    Exporting
    DISPLAY_PARAMETERS
    CALL FUNCTION 'BAPI_ALM_ORDERHEAD_GET_LIST'
    EXPORTING
       DISPLAY_PARAMETERS       =
    " IMPORTING
    "   NAVIGATION_DATA          =
      TABLES
        IT_RANGES                =
        ET_RESULT                =
    "   ET_TEMPLATE              =
        RETURN                   =
    Regards,
    Lalit Mohan Gupta.

  • Xquery does not return any results on 10.2.0.4, does work on 10.2.0.5

    I have a Xquery statement that works as expected on Oracle 10.2.0.5 but does not return any results on Oracle 10.2.0.4.
    Is this the result of a badly written query? A bug in 10.2.0.4?
    Is there a way to rewrite the query so that is does work on 10.2.0.4?
    Testcode:
    declare
       l_xml xmltype;
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.*
            from xmltable(xmlnamespaces(default 'http://www.opengis.net/wmts/1.0'
                                       ,'http://www.opengis.net/ows/1.1' as "ows"
                                        ,'http://schemas.opengis.net/gml' as "gml"
                                        ,'http://www.w3.org/1999/xlink' as "xlink"
                                        ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi")
                          ,'for $d in //Layer[TileMatrixSetLink/TileMatrixSet="EPSG:28992"] return $d' passing
                          p_xml columns title varchar2(100) path 'ows:Title'
                          ,format varchar2(100) path 'Format'
                          ,style xmltype path 'Style') as t;
    begin
       l_xml := xmltype.createxml('<?xml version="1.0" encoding="UTF-8"?>
    <Capabilities xmlns="http://www.opengis.net/wmts/1.0"
    xmlns:ows="http://www.opengis.net/ows/1.1"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:gml="http://www.opengis.net/gml" xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
    version="1.0.0">
    <Contents>
      <Layer>
        <ows:Title>brtachtergrondkaart</ows:Title>
        <ows:Identifier>brtachtergrondkaart</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>top10nl</ows:Title>
        <ows:Identifier>top10nl</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
      <Layer>
        <ows:Title>bgt</ows:Title>
        <ows:Identifier>bgt</ows:Identifier>
        <Style isDefault="true">
          <ows:Identifier>_null</ows:Identifier>
        </Style>
        <Format>image/png8</Format>
        <TileMatrixSetLink>      <TileMatrixSet>EPSG:28992</TileMatrixSet>
        </TileMatrixSetLink>  </Layer>
    </Contents>
    </Capabilities>');
       for r_layer in c_layer(l_xml)
       loop
          dbms_output.put_line(r_layer.title);
       end loop;
    end;Result on 10.2.0.5:
    brtachtergrondkaart
    top10nl
    bgt

    This one's strange indeed.
    I can reproduce on 10.2.0.4 and one of the following seems to fix it :
    1) Specifying the column list in the SELECT, instead of t.* :
       -- Select layers with TileMatrixSet EPSG:28992
       cursor c_layer(p_xml xmltype) is
          select t.title, t.format, t.style
            from xmltable(or,
    2) Using an extended FLWOR expression :
    for $d in //Layer
    where $d/TileMatrixSetLink/TileMatrixSet = "EPSG:28992"
    return $dMaybe you've already noticed but the problem only occurs within a PL/SQL context.
    The same query run from SQL is OK.

  • SDO_RELATE does not return expected points

    Hi,
    I have a problem with a query which does not return the results I am expecting. I think it may be to do with geodetic data v projected data but fail to see how.
    the table points2 contains point data stored in Lat Long (SRID 8307)
    Here is my query:
    SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
    WHERE SDO_RELATE (points2.ASSETEXTENT, MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,1831699.1743184,645000.053168677)),'mask=anyinteract') = 'TRUE';
    This query returns 0 results. if perform the same query with SDO_FILTER rather than SDO_RELATE then I get 1 result (which is what I expect). the result is this:
    MDSYS.SDO_CS.TRANSFORM(POINTS2.ASSETEXTENT,26943)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    SDO_GEOMETRY(3001, 26943, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(1831689.17, 644440.053, 0))
    1 row selected.
    As can clearly be seen from this result the point is 10m from the both vertical edges of the optimised rectangle and at least 60m from the horizontal edges.
    The sdo_geom_metadata_table entry for this table is:
    SDO_OWNER SDO_TABLE_NAME
    SDO_COLUMN_NAME
    SDO_DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)
    SDO_SRID
    VST POINTS2
    ASSETEXTENT
    SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .005), SDO_DIM_ELEMENT('Y', -90, 90, .005), SDO_DIM_ELEMENT('Z', -999, 5000, .005))
    8307
    Anyone got any pointers? If you need more info just let me know
    Sam

    hi,
    can you try this query and let us know what you get ?
    Transform the geometry to 8307 and pass it into the sdo_relate
    operator.
    SELECT mdsys.sdo_cs.transform(points2.assetextent,26943) FROM points2
    WHERE SDO_RELATE (points2.ASSETEXTENT,
    sdo_cs.transform(MDSYS.SDO_GEOMETRY(2003,26943 ,NULL, mdsys.SDO_ELEM_INFO_ARRAY(1,1003,3), mdsys.SDO_ORDINATE_ARRAY(1831679.1743184,644380.053168771,
    1831699.1743184,645000.053168677)), 8307), 'mask=anyinteract') = 'TRUE';

  • Procedure Does not return expected new rows unless I ALTER the procedure it self

    Procedure Does not return expected new rows !!!   unless I ALTER the procedure it self

    And what exactly do you alter, the code / where clause / or ...?
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Query for file version less than 10.0 does not return expected data

    I'm trying to build a query for all PCs that have a version of Iexplore.exe in c:\windows\program files\ that is less than 10.0 .  When I run the query it returns no data. When I change 10.0 in the query to 9.9 it returns files with version 10.xxx in
    the results.  Its as if it is seeing 10.0 as 1.0.   Is this expected ?
    select SMS_R_System.Name, SMS_R_System.ADSiteName, SMS_G_System_SoftwareFile.FileName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where
    SMS_G_System_SoftwareFile.FileName = "iexplore.exe" and SMS_G_System_SoftwareFile.FilePath = "C:\\program files\\internet explorer\\" and SMS_G_System_SoftwareFile.FileVersion < "9.9"

    It is because the values are not integer, they are a string. And therefore 1 is smaller then 9.
    http://www.enhansoft.com/

  • Refresh using alias table not returning expected results

    I am getting some unexpected results in SmartView and can't figure out the cause. I have an Essbase cube that has two alias tables: the "default" and one that I call "Short Descr". I can consistently bring back data using "none" and "default", but not "Short Descr". When I use "Short Descr" data will come back for some of the members, but not for others.
    Here is an example of a query using "none" as the alias table:
         Net Income      
         RD10078      
         Y-T-D(MAR)      
    PRJG939306      20,372.05      
    PRJLG921508      (26.42)     
    Project      (1,179,752.36)     
    If I change the alias table to "Short Descr", I get the following results:
         Net Income      
         ITA (RD10078)      
         Y-T-D(MAR)      
    PRJG939306 (PRJG939306)      20,372.05      
    PRJLG921508 (PRJLG921508)      (26.42)     
    Project      (1,179,752.36)     
    But then if I just clear the amounts, and do a refresh, I get the following:
         Net Income      
         ITA (RD10078)      
         Y-T-D(MAR)      
    PRJG939306 (PRJG939306)           
    PRJLG921508 (PRJLG921508)      (26.42)     
    Project      (1,179,752.36)     
    And if I pivot Net Income, I get a message that "Any comments/ functions/ formulas on the sheet will be lost.", and the PRJG939306 member is lost.
              ITA (RD10078)      
              Y-T-D(MAR)      
    Net Income      PRJLG921508 (PRJLG921508)      (26.42)     
    Net Income      Project      (1,179,752.36)     
    I can't figure out why it would start treating it as a comment. It looks to be a valid member name and I don't see anything strange if I look at the member properties in EAS. And what I really don't understand is why it would bring back the member name (with alias) and a data value when I change the alias table from "none" to "Short Descr", but not bring back a value when I just clear the amounts and do a Refresh. And why is it only doing it for some of the members and not all of them?
    What could cause this type of behavior?

    lets see if I can say this clearly. Smartview will noit convert from one alias to another. Before switching alias tables, try changing back to no alias and do a retrieve, then switch to the new alias table and retrieve. I think the problem is Smartview is not interpeting what is on the one line so it leave it blank as an unknown member.

  • Search with multiple words not returning expected results

    I am using RoboHelp 9 and was performing my search on published WebHelp.
    In the Help there is a topic named "Port and Path Connection States" which references a status of "port not started".
    When I search for "port not started" (with quotes) the topic is returned.
    When I search for "port not started" (without quotes), I get this message: "The words you typed is not a valid expression.".
    I thought this search would be treated as an OR search, and I would get results for all topics that contained the word "port" or "not" or "started", but instead the expression is not valid. Can anyone tell me why? 

    Check your list of Stop words. It may include NOT.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • REGEXP_LIKE not returning expected results

    My first attempt at REGEXP_LIKE and I'm obviously missing something. I've tried several suggestions I found in the forum but cannot get the correct results. I need the following query to return only those rows containing only alphabetic characters (no numbers). What I get are rows containing letters and numbers.
    Any help will be greatly appreciated!
    Randy
    SELECT order_number
    FROM order_table
    where REGEXP_LIKE(order_number,'[a-z A-Z]')

    check below the various options which you can use to search different elements
    Character Class   Syntax Meaning
    [:alnum:]             All alphanumeric characters
    [:alpha:]              All alphabetic characters
    [:blank:]              All blank space characters
    [:cntrl:]                All control characters (nonprinting)
    [:digit:]                All numeric digits
    [:graph:]             All [:punct:], [:upper:], [:lower:], and [:digit:] characters
    [:lower:]              All lowercase alphabetic characters
    [:print:]               All printable characters
    [:punct:]              All punctuation characters
    [:space:]             All space characters (nonprinting)
    [:upper:]             All uppercase alphabetic characters
    [:xdigit:]              All valid hexadecimal characters

  • Custom Search does not return search results

    I created a custom search application and another aaplication for choosing different pages from a list of values.
    When I add both of these applications in the same page with search on the top and the other application on the bottom, everything works fine. But if I add search on the bottom and the other application on the top, I get a page not found for search results.
    any idea why this is happening?
    note: I took the html code from the standard search to create the custom search application.
    Thanks.

    It was a minor coding issue. Problem solved.

  • BAPI_SALESORDER_CREATEFROMDAT2 does not return the results of ATP

    we are developing an interface from the customer software to our SAP-system. We are getting Sales Order and perform the with BAPI_SALESORDER_CREATEFROMDAT2. In the case the customer ordes more than available a schedule line is created but confirmed quantitiy is 0. There is no error log or atp message in the BAPI.
    Our idea is to get the available quantity as confirmed quantity.
    Does somebody know how I can solve this?
    kind regards,
    Thomas Robier

    close (not answerdeD)

  • Bing based federated result sources not returning any results for non-English languages

    I have a result source with this query:
    http://www.bing.com/search?q={?searchterms}  language:fr site:msdn.microsoft.com&format=rss&count=50&first={startIndex}
    This used to give me 40-50 results for common terms like download, blog etc.
    From today (7/14) IST, this source does not return any results. There are no results if I execute this query directly in IE either.
    Same behavior observed for: language:es, language:de etc.
    I do however get results as expected for language:en.
    Any idea what the issue might be?

    Hi Swapnil,
    According to your description, my understanding is that no results returned when searching with non-English in the Result Source query.
    I tested the same scenario per your post and I got the same results as you got.
    I recommend to change the language:fr in the Result Source query to be lang=fr to see if the issue still occurs.
    More references:
    http://kbdump.com/sharepoint-2013-opensearch-search-twitter-facebook-wikipedia-page/
    http://richardstk.com/2013/11/08/sharepoint-2013-federated-search-to-bing/
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Search does not return my documents

    Hi Gurus,
    I have created few documents using CM SDK. I could able to see these documents using IFS browser.
    Now I wrote content search method to search document content.When I search for "cmsdk" string it returns 13 documents.But when I search for a string in the document, I created , for example a text like "struts" it does not return any result , though this document I can see in IFS browser.What could be the reason?.
    BTW I didn't create any FORMAT type while I am storing the document. Can any one point me to a document where I can find some instructions on "must and should things to do before search".
    I am using CM SDK 9.0.3.
    Thanks in advance.
    Giri.

    have you set the indexing on?

  • Designer 10gR2 :API: JR_CHECK_REF.CHECK_FOL_REFS does not return proper res

    Summary: API: JR_CHECK_REF.CHECK_FOL_REFS does not return proper results
    Description:
    For User Extensions, the API is returning unexpected/unexplained results for Association types identified as not in the repository.
    Scenario 1) EL_TYPE and REF_TYPE return properties that are not aligned with either the EL_IRID/EL_IVID, EL_PAR_IVID, or REF_PAR_IRID.
    However, REF_IRID (pointing to the missing object) is correct.
    Scenario 2) EL_TYPE and REF_TYPE return properties that are not aligned with either the EL_IRID/EL_IVID, EL_PAR_IVID, or REF_PAR_IRID.
    However, all the objects are present in the repository.
    Any idea?
    ~Shampa M.

    You might get a better response if you ask this in the Designer Forun.

  • Content scope document library does not return result for non farm administrator

    Hi
    I have a situation where I had to go with a unique permission applied subsite to store 1000 documents in the document library. This site has a set of 50 users. I was able to create content scope and library path for search. It returns results for me(creator/owner/administrator)
    however if I add other users as contributor or full permission, even after full crawling it does not return result for others.
    I saw some article that security broken site wont be indexed normal way and to include and I did that as well but no result for other users. I always get result.
    Please suggest if there are any specific security permissions that I need to include, so the document library target search will return result for others.
    Thanks
    Shri

    Hi Shri,
    For administrator search results, it looks like the documents could be crawled and searched.
    For other users you grant full control permission on subsite with unique permission where you store 1000 dcouments in document library, please make sure these 50 users have access permission(at least view permission) on documents from the
    library, then test again.
    Also test if users search on search center site without search scope, see if it's scope issue or search web part issue.
    If above doesn't work, please check ULS log for related useful information around the time when users search the documents, there should be more info to verify if issue is related to unique permision.
    Thanks,
    Daniel Yang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • IWeb not seeing .Mac Web gallery photo albums

    I uploaded a photo album created in iPhoto to .Mac Web Gallery. The photo album is accessible on the web. When I go into iWeb to put a link to it, I've gone to Insert>.Mac Web Gallery, which is what the instructions say you are supposed to do. Howeve

  • Installing EM agents with multiple oracle owners

    Hi I am planning to install and configure EM Grid Control in my environment. How many agents do I need to configure if I have several oracle software owners on a server e.g. server1: - oracle9 for Oracle 9i database - oracle10 for Oracle 10gR1 databa

  • Content not getting refresh on Portal Page

    Hi, The structure of my page is WorkSet->Page-> iView1 + iView2. Prob 1: iView1 is a URL iView and the page to be displayed is an html page stored on the server. I  changed the content of the html page on the server but the same is not getting reflec

  • Photo Thumbs Weight More Than Full-Size Photos

    I have a problem with my iPod Video 30 GB. Basically when I try to sync full-size photos that weight about 3 GB and iTunes converts them into thumbs on iPod they show as being 12 GB. How can small thumbs weight more than actual full-size photos? Plea

  • How to run a vi without using menu button on top

    i got to execute or run the labview program without using the menu button.There should be a button on front panel clicking on to it must run the vi.