Error - DRG-51030: wildcard query expansion resulted in too many terms

Hi All,
My searches against a 100 million company names table on org names often result in the following error:
DRG-51030: wildcard query expansion resulted in too many terms
A sample query would be:
select v.* --xref.external_ref_party_id,v.*
from xxx_org_search_x_v vwhere 1 =1
and state_province = 'PA'
and country = 'US'
and city = 'BRYN MAWR'
and catsearch(org_name,'BRYN MAWR AUTO*','CITY=''BRYN MAWR''' ) > 0
I understand that is caused by the presence of the word Auto to which we append a * . (If i remove the auto the search works fine).
My question is - is there a way to limit the query expansion to only , say 100, results that get returned from the index?

Thanks for the reply. This is how the preferences are set:
exec ctx_ddl.create_preference('STEM_FUZZY_PREF', 'BASIC_WORDLIST');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_MATCH','AUTO');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_SCORE','60');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','FUZZY_NUMRESULTS','100');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF','STEMMER','AUTO');
exec ctx_ddl.set_attribute('STEM_FUZZY_PREF', 'wildcard_maxterms',15000) ;
exec ctx_ddl.create_preference('LEXTER_PREF', 'BASIC_LEXER');
exec ctx_ddl.set_attribute('LEXTER_PREF','index_stems', 'ENGLISH');
exec ctx_ddl.set_attribute('LEXTER_PREF','skipjoins',',''."+-/&');
exec ctx_ddl.create_preference('xxx_EXT_REF_SEARCH_CTX_PREF', 'BASIC_STORAGE');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'K_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'N_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_INDEX_CLAUSE','tablespace ICV_TS_CTX_IDX Compress 2');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'P_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX ');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'I_ROWID_INDEX_CLAUSE','tablespace ICV_TS_CTX_IDX ');
exec ctx_ddl.set_attribute('xxx_EXT_REF_SEARCH_CTX_PREF', 'R_TABLE_CLAUSE','tablespace ICV_TS_CTX_IDX LOB(DATA) STORE AS (CACHE) ');
exec ctx_ddl.create_index_set('xxx_m_iset');
exec ctx_ddl.add_index('xxx_m_iset','city, country');
exec ctx_ddl.add_index('xxx_m_iset','postal_code, country');
Users will always use city or postal code when searching for a name. When I run this query -
SELECT dr$token
FROM DR$XXX_EXT_REF_SEARCH_CTX_I1$I
where dr$token like 'AUTO%'
ORDER BY dr$token desc
i get more than 1M rows.
is there a way to include and search for the city name along with the org name?
Thanks again..

Similar Messages

  • DRG-51030: wildcard query expansion resulted in too many terms

    Hello,
    I have sql report in my apex application that is based on sql query with oracle text. I am trying to execute query with % parameter: select * from mytable where contains(term, '%')>0
    I now that wildcard_maxterms default maximum is 5000 and in sql-developer query works normally without any errors, but in apex I receive DRG-51030: wildcard query expansion resulted in too many terms.
    Please help!!!

    Hello,
    There's a good discussion of that exception here -
    How to limit the number of search results returned by oracle text
    John
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • DRG-51030: wildcard query expansion

    Hi,
    encountered an error when I ran this,
    SELECT /*+use_hash(t$oracle_text)*/
    count(documentid)
    FROM t$oracle_text
    WHERE CONTAINS (
    dummy,
    'near(((approv%=underwrit%=report%),(waive%=exception%=override%)),10)',
    1) > 0
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    I have few question:
    1) what is this = sign in where clause.
    2)How to get rid of this error .
    3)is there any other alternative to run this without hitting wildcard query expansion limit.
    Thanks,

    Hello,
    There's a good discussion of that exception here -
    How to limit the number of search results returned by oracle text
    John
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • DRG-51030: wildcard query expansion after using @

    The following query returns one row:
    select * from userinterface where contains (searchtx, 'Mustermann within name and %gmx.de within email')>0;
    returns one row.
    If I add @ (=> %@gmx.de within email) the following error occurs:
    select * from userinterface where contains (searchtx, 'Mustermann within name and %@gmx.de within email')>0;
    returns
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    Is the character @ a special character causing the wildcard query expansion? "@gmx.de" is more restictive compared to "gmx.de" (Oracle 10.2.0.4)
    select * from userinterface where contains (searchtx, 'Mustermann within name and %de within email')>0;
    is also working and returns three rows.

    Like Roger said, you could include the @ in your printjoins attribute of your basic_lexer and use a substring_index, then that might allow you to search for '%@gmx.de' and find '[email protected]' without encountering the wildcard expansion error. Increasing the wildcard_maxterms would also make the error less likely. However, I believe that is using Oracle Text in a manner other than it is intended and will cause more problems than it will solve, like increasing the size of your domain index tables by storing substrings and making your searches slower.
    If you just leave things the way they are, then @ and . are treated as spaces and '[email protected]' is seen as 'somebody gmx de' and indexed as three separate words, so searching for '@gmx.de' will search for 'gmx de' and will find it, so there is no need for a leading wildcard. If you want to avoid problems with errors due to users entering unnecessary leading wildcards with such special characters, then you can replace them in the string before searching. I usually find it convenient to create a cleanup function and include any such problems, then include that in my code that uses a bind variable for the search string. Please see the example below.
    SCOTT@orcl_11gR2> -- table:
    SCOTT@orcl_11gR2> create table userinterface
      2    (id       number,
      3       searchtx  xmltype)
      4  /
    Table created.
    SCOTT@orcl_11gR2> -- lexer:
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference('german_lexer','basic_lexer');
      3    ctx_ddl.set_attribute('german_lexer','composite','german');
      4    ctx_ddl.set_attribute('german_lexer','mixed_case','yes');
      5    ctx_ddl.set_attribute('german_lexer','alternate_spelling','german');
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> -- index:
    SCOTT@orcl_11gR2> CREATE INDEX ui_t_ind on userinterface (searchtx)
      2       indextype is ctxsys.context
      3            PARAMETERS ('
      4                 SECTION GROUP ctxsys.auto_section_group
      5                 LEXER        german_lexer
      6                 MEMORY        100000000
      7                 SYNC        (MANUAL)'
      8            )
      9  /
    Index created.
    SCOTT@orcl_11gR2> -- insert data:
    SCOTT@orcl_11gR2> insert /*+ APPEND */ into userinterface (id, searchtx)
      2  values (1, xmltype (
      3  '<?xml version="1.0"?>
      4  <data>
      5    <name>Mustermann</name>
      6    <email>[email protected]</email>
      7  </data>'))
      8  /
    1 row created.
    SCOTT@orcl_11gR2> insert /*+ APPEND */ into userinterface (id, searchtx)
      2  values (2, xmltype (
      3  '<?xml version="1.0"?>
      4  <data>
      5    <name>Hans Haeberle</name>
      6    <email>[email protected]</email>
      7  </data>'))
      8  /
    1 row created.
    SCOTT@orcl_11gR2> -- synchronize, then optimize with rebiuld:
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.sync_index ('ui_t_ind');
      3    ctx_ddl.optimize_index ('ui_t_ind', 'rebuild');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> -- what is tokenized, indexed, and searchable:
    SCOTT@orcl_11gR2> select token_text from dr$ui_t_ind$i
      2  /
    TOKEN_TEXT
    DATA
    EMAIL
    Haeberle
    Hans
    Häberle
    Mann
    Muster
    Mustermann
    NAME
    com
    de
    gmx
    somebody
    unknown
    whatever
    15 rows selected.
    SCOTT@orcl_11gR2> -- function to clean up search strings:
    SCOTT@orcl_11gR2> create or replace function cleanup
      2    (p_string in varchar2)
      3    return         varchar2
      4  as
      5    v_string     varchar2 (100);
      6  begin
      7    v_string := p_string;
      8    v_string := replace (p_string, '%@', ' ');
      9    return v_string;
    10  end cleanup;
    11  /
    Function created.
    SCOTT@orcl_11gR2> show errors
    No errors.
    SCOTT@orcl_11gR2> -- example search strings, queries, and results:
    SCOTT@orcl_11gR2> column name  format a15
    SCOTT@orcl_11gR2> column email format a20
    SCOTT@orcl_11gR2> variable search_string varchar2 (100)
    SCOTT@orcl_11gR2> begin
      2    :search_string :=
      3        'Mustermann within name and %@gmx.de within email';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> select id,
      2           extractvalue (u.searchtx, '//name') name,
      3           extractvalue (u.searchtx, '//email') email
      4  from   userinterface u
      5  where  contains (searchtx, cleanup (:search_string)) > 0
      6  /
            ID NAME            EMAIL
             1 Mustermann      [email protected]
    1 row selected.
    SCOTT@orcl_11gR2> begin
      2    :search_string :=
      3        'Häberle within name and unknown@whatever within email';
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> select id,
      2           extractvalue (u.searchtx, '//name') name,
      3           extractvalue (u.searchtx, '//email') email
      4  from   userinterface u
      5  where  contains (searchtx, cleanup (:search_string)) > 0
      6  /
            ID NAME            EMAIL
             2 Hans Haeberle   [email protected]
    1 row selected.
    SCOTT@orcl_11gR2>

  • Error MDX result contains too many cells (more than 1 million). (WIS 10901)

    Hi,
    We have developed an universe on BI query and developed report on it. But while running this BO query in Web Intelligence we get the following error
    A database error occured. The database error text is: Error in MDDataSetBW.GetCellData.  MDX result contains too many cells (more than 1 million). (WIS 10901)
    This BO query is restricted for one document number.
    Now when i check in the BI cube there are not more than 300-400 records for that document number.
    If i restrict the BO query for document number, delivery number, material and acknowledged date then the query runs successfully.
    Can anyone please help with this issue.

    follow this article to get the mdx generated by the webi report.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90b02218-d909-2e10-1988-a2ca74547900
    then try to execute the same in mdxtest transaction in bw

  • MDX result contains too many cells - But relese note applied!!!!!!

    Hi experts!
    When I create a query with my infoview, it retrive me the following error:
    <ERROR COMPONENT="WIS" ERRORCODE="10901" ERRORTYPE="USER" MESSAGE="Si è verificato un errore del database. Il testo dell&apos;errore del database è: Errore in MDDataSetBW.GetCellData.  MDX result contains too many cells (more than 1 million). (WIS 10901)" PREFIX="ERR">
    I try to understand if there are some problems about the sap.notes. In particular I ask to the technical people if the following note had installed into my system:
    Note 931479 - MDX: More than 1,000,000 instances per axis
    The technical people said me that this note had been installed because the system is to level 23.
    bold
    Then what problem may be due the fact that my mdx is not able to contains more than 1 million of cell ?
    bold
    thank'you in advance !

    Hi,
    whats the release of the SAP BW System - including patch level ?
    whats the release of the SAP BusinessObjects system including patch level ?
    Ingo

  • MDX result contains too many cells - NUMC 6

    Hi to all.
    I'm using I bex query in order to retrieve the field to my universe.
    I know that when there is an element defined as NUMC (6), some errors may occurs into the MDX extraction (e.g.  MDX result contains too many cells (more than 1 million)).
    Can I set everythink in my BEX query or in my universe definition in order to not change the caratcteristic in my SAP BW system ?
    Indeed I will have some bureaucratic and formal problem to change the sap bw type definition of the caracteristics.
    Thank'you in advance.

    hi Ingo,
    Are you sure ? Indeed when I try to run a query where I have a NUMC6 filed and another field there is the error attached above.
    Instead when I run the same query without the NUMC6 field the query  ends correctly.
    Moreover I see in the "SAP Note 1378064" where I see in the "Reason and Prerequisites": The internal data types are incorrect due to NUMC(6). The conversion to integer is required.
    But I don't know if this conversion is allowed in the Bex Query step or in the universe filed definition.
    Any advice will be accepted !

  • "This webpage has a redirect loop"     "....resulted in too many redirects"

    Hi, I am trying to connect to a cloud account for the first time.
    BUT I get this error here...
    This webpage has a redirect loop
    The webpage at https://database-xxxxxx.db.us1.oraclecloudapps.com/apex/f?p=4500:1000:118209995883759 has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
    Here are some suggestions:
    Reload this webpage later.
    Learn more about this problem.
    Any help appreciated,
    Bill

    Found the problem!
    Oracle - need to capture that error and make more descriptive.
    maybe - "User does not have the proper role to view this page"
    I went into the
    Identity Management Console:     https://idmconsole.us1.cloud.oracle.com/identity/faces/pages/Identity.jspx
    for my Domain.
    "Manage Roles" - hit search (because the roles don't show if you don't hit the search button)
    and then Assigned the "Database Developer" and "Database Administrator" roles to the users that were getting the error.

  • Urgent: Oracle Text error: DRG-10001: can not access result table

    Hi,
    I am getting the "DRG-10001:can not access result table" error when trying to run the oracle text procedure ctx_cls.train within HTMLDB. The schema i used for parsing is granted with the necessary privileges, and i can run the procedure manually using the same schema in sqlplus. Following is the script I am trying to run:
    1. begin
    2. ctx_cls.train(
    3. index_name => 'MyDocindex',
    4. docid => 'MyDoc_id',
    5. cattab => 'MyDocTab_categories',
    6. catdocid => 'cat_MyDoc_id',
    7. catid => 'cat_id',
    8. restab => 'rules',
    9. rescatid => 'rule_cat_id',
    10. resquery => 'rule_text',
    11. resconfid => 'rule_confidence'
    12. );
    13. end;
    Please help urgently!
    Thanks
    RG

    I seem to have hit a similar problem.
    Did you eventually resolve this problem?
    Rgds
    Z

  • Tag Query History mode returning too many rows of data

    I am running a Tag Query from HQ to a plant site and want to limit the amount of data that returns to the minimum required to display trends on a chart.  The minimum required is subjective, but will be somewhere between 22 and 169 data points for a weeks data.  Testing and viewing the result is needed to determine what is an acceptable minimum. 
    I build a Tag Query with a single tag and set it to History Mode.  I set a seven day period going midnight to midnight.  And I set the row count to 22.  When I execute the query it returns 22 data points.  But when I go to visualization, I get 565 datapoints.  So obviously that is not what I want as I want a very slim dataset coming back from the IP21 server (to minimize the load on the pipe). 
    Any suggestions?

    Hi Michael,
    it looks to me like you have enabled the "Use Screen Resolution" option in your display template or in the applet HTML. Setting this option makes the display template fetch as many rows as there are pixels in the chart area. Like setting a rowcount in the applet HTML as a param, this will override any rowcount limitations you have set at the Query Template level...
    Hope this helps,
    Sascha

  • Chart duplicating Series results in too many legend items

    I've created an item for this on bugs.adobe.com - https://bugs.adobe.com/jira/browse/FLEXDMV-2258
    My client requires this in order to finish the application I am working on so I'm hoping someone has a workaround or suggestions for me.
    The forum would not allow me to attach my jpg and mxml file but they are available on the bug url above
    Copied from the bug:
    My application has a collection of machines, each of which has the same properties. I want to graph those properties, but organize them by dates (the values of the properties are different for different days). So the y axis items are dates, and each date has a cluster of machines. Each date has the same number of machines and each machine has the same properties. The issue I'm having is that I want each property (in the example there are 3 properties, represented by BarSeries) to have the same color for each machine in each cluster. So overall, there should only be 3 colors and the legend should have 3 items. Instead, the chart creates different colors for each machine (represented by a BarSet), so there are 3 (machines/BarSets) times 3 (properties/BarSeries) which gives 9 colors and 9 items in the legend. I'm looking to have 3 colors and 3 items in the legend. I was hoping there would be a property on BarSet or BarChart to specify to share BarSeries among the BarSets rather than it forcing unique instances of BarSeries for the BarSets. I tried storing just 3 instances of BarSeries (one for each property) and assigning each BarSet.series property to the stored array of BarSeries, but the outcome was that it would only display one item for each cluster rather than 3.
    Thank you for any suggestions!

    The legend isn't the only problem.  The BarSets are being rendered with different colors for each BarSeries when I want each BarSet to have the same set of colors.

  • CONTAINS search error while using wildcard character

    HI,
    Please help to me,
    CONTAINS search error while using wild-card characters
    SELECT * FROM CUSTOMER WHERE CONTAINS(EMAIL,'test@%',1) > 0;
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-51030: wildcard query expansion resulted in too many terms
    Thanks

    I am not sure about the error. But This posting may give you some ideas
    How to limit the number of search results returned by oracle text
    Please have a look.

  • Limit number of rows from wildcard expansion- DRG-51030

    We use CONTEXT iindex in 11g to search on a text DB column, "Name".
    This is used in a UI to show autosuggest list of 25 matching names.
    When the end user types an 'a' we want to show a list of the first 25 names that contain an 'a'.
    We hit the issue of too many matches in the wildcard expansion query:
    DRG-51030: wildcard query expansion resulted in too many terms
    This is a frequent use case when the user types just 1 character ('a' will easily match over 50K names in our case).
    Is there a way to make the wildcard expansion query only return the first 25 rows?
    We never show more than 25 names in our UI - so we would like the expansion query to also return max of 25 rows.
    Our query is:
    SELECT ResEO.DISPLAY_NAME,
    ResEO.RESOURCE_ID,
    ResEO.EMAIL
    FROM RESOURCE_VL ResEO
    WHERE CONTAINS (ResEO.DISPLAY_NAME , '%' || :BindName || '%' )>0
    Also,
    Is there a way to use CTXCAT type of index and achieve this (expansion query limit of 25)?
    We are considering switching to CTXCAT index based on documentation that recommends this type of an index for better performance.

    Your best bet may be to look up the words directly in the $I token table.
    If your index is called NAME_INDEX you could do:
    select /* FIRST_ROWS(25) */ token_text from
      (  select token_text
         from dr$name_index$i  
         where token_text like 'A%' )
    where rownum < 26;That should be pretty quick.
    However, if you really want to do %A% - any word which has an A in it - it's not going to be so good, because this will prevent the index being used on the $I table - so it's going to do a full table scan. In this case you really need to think a bit harder about what you're trying to achieve and why. Does it really make any sense to return 25 names which happen to have an A in them? Why not wait until the user has typed a few more characters - 3 perhaps? Or use my technique for one or two letters, then switch over to yours at three characters (or more).
    A couple of notes:
    - Officially, accessing the $I table is not supported, in that it could change in some future version, though it's pretty unlikely.
    - I trust you're using the SUBSTRING_INDEX option if you're doing double truncated searches - a wild card at the beginning and end. If not, your performance is going to be pretty poor.

  • Error in executing wilcard query, strange!!!

    Select c1.docid from S3TSTPUBG.cmdoccontents c1,S3TSTPUBG.cmdocuments c2 where
    (contains(CONTENTDATA, ' ( (%mad% WITHIN searchkeywords ) WITHIN en ) ', 1 ) > 0 )
    gives 0 results ....(valid query)
    whereas
    Select c1.docid from S3TSTPUBG.cmdoccontents c1,S3TSTPUBG.cmdocuments c2 where (contains(CONTENTDATA, ' ( (%m% WITHIN searchkeywords ) WITHIN en ) ', 1 ) > 0 )
    gives Intermedia error , wildcard query expansion resulted in........
    Any idea ?

    Paarently this is in 8.x series only as in 9.x an extra parameter WILDCARD_MAXTERMS has been included

  • DRG-50901: text query parser syntax error

    The query
    SELECT * FROM ij
    where
    CONTAINS (ij.summary, 'ATTENZIONE!') > 0 returns an error:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-20000: Oracle Text error:
    DRG-50901: text query parser syntax error on line 1, column 13
    Why?
    There is a TEXT index on the summary column:
    CREATE INDEX IJL_SUMMARY_IX ON IJ
    (SUMMARY)
    INDEXTYPE IS CTXSYS.CONTEXT
    PARAMETERS('
        lexer           MITO_LEXER
        wordlist        DEFAULT_WORDLIST
        stoplist        IJL_STOPLIST
        storage         IJL_TEXT_STORAGE
        SYNC (EVERY "SYSDATE + 10/1440")')
    PARALLEL ( DEGREE 4 INSTANCES 1 );where the MITO_LEXER is
    BEGIN
    CTX_DDL.create_preference ('mito_lexer', 'BASIC_LEXER');
    CTX_DDL.set_attribute ('mito_lexer', 'INDEX_STEMS', 'ITALIAN');
    -- MITO-318: search on Text Index for Asterisks
    CTX_DDL.set_attribute ('mito_lexer', 'printjoins', '*');
    END;
    /

    Because the exclamation mark ("!") is a reserved operator, meaning soundex, and must appear before the word it applies to.

Maybe you are looking for

  • Should I use a static method or an instance method?

    Just a simple function to look at a HashMap and tell how many non-null entries. This will be common code that will run on a multi-threaded weblogic app server and potentially serve many apps running at once. Does this have to be an instance method? O

  • Taking Complete Control doesn't block user's mouse/keyboard...

    When observing a computer, if I take control of the system, I can move the cursor and such, the user is locked out. But, if I let my mouse rest for a moment, the user can takeover control of the cursor, type, ect... which defeats the purpose of contr

  • Problems shutting down, starting up

    My IMac has been giving me several problems lately. It sometimes will not go to sleep, and when it does, will not wake up. I have to re-start the computer to wake it up. It often shuts down with no warning or the grey film comes over and says the Mac

  • Unable to check for purchases, an unknown error has occured (5002)

    Unable to check for purchases, an unknown error has occured (5002) I was in the middle of download and got an error. (I didn't write down that error) I restarted Itunes and then got this error. I then upgraded to the latest patch (from 7.1 to 7.1.1)

  • Sequential processing DTP

    Hi, To have my global variable values in the routines available in the processing of all the data-packages I need to set the DTP to sequential processing. Is this still possible in 7.0? (in 3.5 it was done by setting infopackage update mode to PSA on