Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ConText and base_letter
The problem is that you are not setting the NLS_LANG environment
variable in the session where you're starting the ConText server.
What is the NLS_LANG setting on the server??
Ensure that you are setting the NLS_LANG parameter correctly and that the language is supported by the character-set installed for the database.
Your example works fine for me (Oracle8 8.0.5, ConText 2.4.5 on Solaris 2.6):
Wed Jan 6 09:08:28 EST 1999
oracle_at_bulldog:/tmp
ctxsrv -user ctxsys/ctxsys -personality qdm -logfile /tmp/ctx.log &
[1] 5194
Wed Jan 6 09:08:28 EST 1999
oracle_at_bulldog:/tmp
sqlplus scott/tiger
> sqlplus scott/tiger
SQL*Plus: Release 8.0.5.0.0 - Production on St Led 6 9:32:39 1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Připojeno k:
Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
With the Partitioning and Objects options
PL/SQL Release 8.0.5.0.0 - Production
SQL> set echo on SQL> @ctx SQL> create table ctx_test1 (id number, doc clob);
Tabulka vytvořena.
SQL> alter table ctx_test1 add primary key (id);
Tabulka změněna.
SQL> insert into ctx_test1 values (1, 'krtek leta');
1 řádka vytvořena.
SQL> insert into ctx_test1 values (2, 'krtek léta');
1 řádka vytvořena.
SQL> insert into ctx_test1 values (3, 'krtek létá');
1 řádka vytvořena.
SQL> exec ctx_ddl.set_attribute('base_letter', 1);
Procedura PL/SQL úspěšně dokončena.
SQL> exec ctx_ddl.create_preference('strip_dia1', 'Strip diacritical marks', 'BASIC LEXER');
Procedura PL/SQL úspěšně dokončena.
SQL> exec ctx_ddl.create_policy(policy_name => 'test_policy', colspec => 'ctx_test1.doc', lexer_pref => 'strip_dia1');
Procedura PL/SQL úspěšně dokončena.
SQL> exec ctx_ddl.create_index('test_policy');
Procedura PL/SQL úspěšně dokončena.
SQL> select count(*) from ctx_test1 where contains(doc,'leta',1) > 0;
COUNT(*)
3
On Wed, 6 Jan 1999 10:26:20 GMT, adelton_at_fi.muni.cz (Honza Pazdziora) wrote:
>Hello,
>
>I'm struggling with base_letter feature of the ConText Cartrige
>(Oracle 8.0.4.0.0 on Solaris, ConText 2.3.6.0.0).
>
>I'm trying to set the index in such a way that the diacritics is
>stripped. Here's my SQL code:
>
>---
>create table ctx_test1 (id number, doc clob);
>alter table ctx_test1 add primary key (id);
>insert into ctx_test1 values (1, 'krtek leta');
>insert into ctx_test1 values (2, 'krtek léta');
>insert into ctx_test1 values (3, 'krtek létá');
>begin ctx_ddl.set_attribute('base_letter', 1); end;
>/
>begin ctx_ddl.create_preference('strip_dia1',
> 'Strip diacritical marks', 'BASIC LEXER'); end;
>/
>begin ctx_ddl.create_policy(policy_name => 'test_policy',
> colspec => 'ctx_test1.doc', lexer_pref => 'strip_dia1'); end;
>/
>begin ctx_ddl.create_index('test_policy'); end;
>select * from ctx_test1 where contains(doc, 'leta', 1) > 0;
>---
>
>I expect this select to find all rows but it only finds the first one.
>So no conversion to base letter took place.
>
>The database is created with
>
> | NLS_LANGUAGE | AMERICAN | Language |
> | NLS_TERRITORY | AMERICA | Territory |
> | NLS_CHARACTERSET | EE8ISO8859P2 | Character set |
> | NLS_SORT | BINARY | Linguistic definition |
> | NLS_NCHAR_CHARACTERSET | EE8ISO8859P2 | NCHAR Character set |
>
>and the result is the same no matter how I have my NLS_LANG env.
>variable set in the client: american_america.EE8ISO8859P2,
>czech_czechoslovakia.EE8ISO8859P2, czech_america.EE8ISO8859P2.
>
>My question is: did anyone have a success in getting base_letter to
>work? Did I miss something in the setup? When and to which value
>should I set the NLS_LANG variable?
>
>Seems like a lot of questions but I'm out of ideas. The docs only
>mention it's possible to do this but with no real life example. When
>I check the setting from a GUI front end from my NT box, the settings
>are there (even if the menus are somehow shifted). Maybe some more
>detailed way of watching the ctx server might helps me see where the
>problem is but I'm only aware of the server log that doesn't say what
>parameters it's indexing with.
>
>Any hint is greatly appreciated,
>
>--
>------------------------------------------------------------------------
> Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
> Boycott the Czech Telecom -- www.bojkot.cz
>------------------------------------------------------------------------
Thanks!
Joel
Joel R. Kallman Oracle Service Industries
Columbus, OH jkallman@us.oracle.com http://www.oracle.com