Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

UI Text Box
typenote

When changing the stoplist of the full-text index, the changes do not take effect until the index is rebuilt.

 

Modifying the default stoplist

The default stoplist is CTXSYS.DEFAULT_STOPLIST, and it used when the index is created without specifying a stoplist. Stopwords can be added or removed from this stoplist as in the following script:

...

  • the default stoplist is owned by the sys user. In order to change the stoplist, the script must be executed as sys.
  • after changing the default stoplist (either adding or removing words), the full-text index needs to be re-created
  • simply rebuilding the index does not have any effect

Creating a new stoplist

A new stoplist can be created and stopwords can be added or removed as in the following script:

...

The above statement must be executed each time the stoplist is modified in order for the changes to the stoplist take effect.

Dynamically adding stopwords

It is possible to add stopwords to the stoplist of the full-text index without having to rebuild the index using the 'alter index parameters' statement:

...

Code Block
languagesql
begin
	-- create a custom stoplist
	ctx_ddl.create_stoplist('example_stoplist, 'BASIC_STOPLIST');
 
	-- add the word 'the' to the stoplist
	ctx_ddl.add_stopword('example_stoplist', 'the');
end;
 
-- create the full-text index with the custom stoplist
create index aq_fulltext_index on aq_fulltext(text) 
	indextype is ctxsys.context 
	parameters ('datastore aq_fulltext_uds stoplist example_stoplist sync(on commit)');
 
-- dynamically add the stopword 'other' to the index
alter index aq_fulltext_index parameters ('add stopword other');
 
-- rebuild the index and withreplace the samestoplist parameters(perhaps asnew thosestopwords usedwere whenadded itto was created,the stoplist)
-- the stopword 'other' is lost, and again present in the index
alter index aq_fulltext_index rebuild parameters ('replace stoplist example_stoplist');
 

It is recommended that if stopwords are dynamically added to the index, then the same stopwords are also added to the stoplist used by the index. In this way, if the stoplist ever has to be replaced, the dynamically added stopwords are not lost. 

UI Expand
titleRelated articles

Content by Label
showLabelsfalse
max5
spacesBKB
showSpacefalse
sortmodifiedshowSpacefalse
reversetrue
typepage
cqllabel in ("bq97","search") and type = "page" and space = "BKB"
labelssearch bq97

 

...