Because that's we are using to locate your row. The key is not mandatory, but if you dont have it, you have to give us the rowid, eg
SQL> create table text_demo (x int,docs varchar2(100));
Table created.
SQL> INSERT INTO text_demo VALUES(1, '<HTML>California is a state in the US.</HTML>');
1 row created.
SQL> INSERT INTO text_demo VALUES(2, '<HTML>Paris is a city in France.</HTML>');
1 row created.
SQL> INSERT INTO text_demo VALUES(3, '<HTML>France is in Europe.</HTML>');
1 row created.
SQL> commit;
Commit complete.
SQL> select x, rowid from text_demo;
X ROWID
---------- ------------------
1 AAAUvEAAHAAAmhGAAA
2 AAAUvEAAHAAAmhGAAB
3 AAAUvEAAHAAAmhGAAC
3 rows selected.
SQL> create index text_demo_idx on text_demo(docs)
2 indextype is ctxsys.context
3 parameters( 'filter ctxsys.null_filter
4 section group ctxsys.html_section_group' );
Index created.
SQL> declare
2 x clob;
3 y varchar2(40);
4 l_len int := 40;
5 begin
6 ctx_doc.markup('text_demo_idx','AAAUvEAAHAAAmhGAAC','France',x);
7 dbms_lob.read(x,l_len,1,y);
8 dbms_output.put_line( 'y = '||y);
9 dbms_lob.freetemporary(x);
10 end;
11 /
PL/SQL procedure successfully completed.
but obviously, a primary key is a more "accessible" piece of information for applications to have when they want to do a markup.