My Oracle Support Banner

Sentences Are Not Recognized With Auto_lexer & <Language>_punctuations Attribute (Doc ID 1086470.1)

Last updated on APRIL 20, 2010

Applies to:

Oracle Text - Version: 11.2.0.1 and later   [Release: 11.2 and later ]
Information in this document applies to any platform.

Symptoms

In 11.2.0.1.0, sentence searching with Oracle Text and use of the AUTO_LEXER doesn't work.


SQL> create table testctx (i integer primary key, c varchar2(2000));

Table created.

SQL> insert into testctx values
  2    (1,
  3     '<DOC><TEXTO> esto es un texto. con dos frases. </TEXTO></DOC>'
  4    );

1 row created.

SQL> commit;

Commit complete.

SQL> begin
  2    ctx_ddl.create_section_group('MySG','AUTO_SECTION_GROUP');
  3    ctx_ddl.add_special_section('MySG','SENTENCE');
  4  end;
  5  /

PL/SQL procedure successfully completed.

SQL> begin
  2    ctx_ddl.create_preference('MyLexer','AUTO_LEXER');
  3    ctx_ddl.set_attribute('MyLexer','LANGUAGE','SPANISH');
  4  end;
  5  /

PL/SQL procedure successfully completed.

SQL> create index ctxidx on testctx(c)
  2    indextype is ctxsys.context
  3    parameters
  4      ('section group MySG
  5        lexer MyLexer');

Index created.

SQL> select *
  2    from testctx;

I C
---------- -----------------------------------------------------------------
1 <DOC><TEXTO> esto es un texto. con dos frases. </TEXTO></DOC>

SQL>
SQL> -- This should return no rows since 'esto' and 'dos'
SQL> -- are in different sentences:
SQL> select *
  2    from testctx
  3    where contains (c, '(esto and dos) within sentence') > 0;

I C
---------- -----------------------------------------------------------------
1 <DOC><TEXTO> esto es un texto. con dos frases. </TEXTO></DOC>

SQL>
SQL> -- This should return 1 row since 'esto' and 'texto'
SQL> -- are in the same sentence:
SQL> select *
  2    from testctx
  3    where contains (c, '(esto and texto) within sentence') > 0;

I C
---------- -----------------------------------------------------------------
1 <DOC><TEXTO> esto es un texto. con dos frases. </TEXTO></DOC>



Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
  Symptoms
  Cause
  Solution
  References

This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.