1 Reply Latest reply: Jan 23, 2013 4:10 PM by Barbara Boehmer RSS

    Orcle Text Fuzzy search on multi-language (English/French)

    942572
      Hello,

      I am using Oracle 11.2, I would like to do fuzzy text match on column contains both English and French letters. How can I set the value for FUZZY_MATCH via ctx_ddl.set_attribute

      Thanks in advance!

      create tb_class(nm varchar2(20), addr varchar2(200));
      insert into tb_class('çadfécc', 'Paris'); commit;

      begin
      ctx_ddl.set_attribute(''STEM_FUZZY_PREF', 'FUZZY_MATCH', 'FRENCH'); ... This is for French only???
      end;

      create index class_nm_idx on tb_class(nm) indextype is ctxsys.context parameters('worldlist STEM_FUZZY_PREF sync (on commit)');

      select * from tb_class where contains(nm, 'çadfcc',,,weight)', 1) > 0;
        • 1. Re: Orcle Text Fuzzy search on multi-language (English/French)
          Barbara Boehmer
          SCOTT@orcl_11gR2> create table tb_class
            2    (nm    varchar2 ( 20),
            3       addr  varchar2 (200))
            4  /
          
          Table created.
          
          SCOTT@orcl_11gR2> insert into tb_class values ('çadfécc', 'Paris')
            2  /
          
          1 row created.
          
          SCOTT@orcl_11gR2> begin
            2    ctx_ddl.create_preference
            3        ('STEM_FUZZY_PREF', 'BASIC_WORDLIST');
            4    ctx_ddl.set_attribute
            5        ('STEM_FUZZY_PREF', 'STEMMER', 'AUTO');
            6    ctx_ddl.set_attribute
            7        ('STEM_FUZZY_PREF', 'FUZZY_MATCH', 'AUTO');
            8    ctx_ddl.create_preference
            9        ('LEXER_PREF', 'BASIC_LEXER');
           10    ctx_ddl.set_attribute
           11        ('LEXER_PREF', 'BASE_LETTER', 'YES');
           12  end;
           13  /
          
          PL/SQL procedure successfully completed.
          
          SCOTT@orcl_11gR2> create index class_nm_idx
            2  on tb_class (nm)
            3  indextype is ctxsys.context
            4  parameters
            5    ('wordlist  STEM_FUZZY_PREF
            6        sync        (on commit)
            7        lexer        LEXER_PREF')
            8  /
          
          Index created.
          
          SCOTT@orcl_11gR2> select * from tb_class
            2  where  contains (nm, 'fuzzy (çadfcc, 1, 5000, weight)', 1) > 0
            3  /
          
          NM
          --------------------
          ADDR
          --------------------------------------------------------------------------------
          çadfécc
          Paris
          
          
          1 row selected.