Sitemap

Monday, June 22, 2015

SortSpec when Configured for OracleTextSearch

When the Content Server is set for SearchIndexerEngineName=OracleTextSearch, only fields in SDATA sections can be used for sorting. Using SortSpec to sort the search results, the correct syntax is:
&SortSpec=<Field> <ASC or DESC>, <Field> <ASC or DESC>

Fields that are optimized as SDATA sections will require the prefix 'sd'. Two standard fields that are already optimized and will require the prefix are dDocName and dDocTitle.
&SortSpec=sddDocTitle ASC,sddDocName ASC,dInDate DESC

and this is how we will be passing the SortSpec key in the binder:
requestBinder.putLocal("SortSpec","sddDocName ASC, dInDate DESC");


To get the full list of SDATA sections
1. Go to UCM Administration --> Configuration. Note the Active Index value. It will be either ots1 or ots2.
2. On the Content Server database schema run the following spool script on the active index:
set long 2000000 
set pages 0 
set heading off 
set feedback off 
spool /tmp/outputfile.txt 
select ctx_report.create_index_script('<Active Index>') from dual; 
spool off

NOTE: The <Active Index> is the index the script will be run against. If the active index is ots1 the ctx_report.create_index_script will be run using FT_IDCTEXT1. If the active index is ots2 the report will be run using FT_IDCTEXT2.
Example: select ctx_report.create_index_script('FT_IDCTEXT1') from dual; 

After the spool completes edit the outputfile.txt file. Look for these entries: ctx_ddl.add_sdata_section. These are the fields that have been configured to be SDATA sections. These will include any fields that were set to be optimized in the Text Search Admin page. Also look for these entries: ctx_ddl.add_sdata_column. These also are SDATA sections. If the number of ctx_ddl.add_sdata_section and ctx_ddl.add_sdata_column entries equals 32 then no new fields can be set to be optimized.


To workaround this limit
Since the 32 limit cannot be increased, one way to reduce the number of SDATA section fields is to disable indexing on the custom metadata fields that won't be required to be searched on. In the ctx_ddl.add_sdata_section and ctx_ddl.add_sdata_column entries, these are the fields that will have an x or sdx prefix.

1. Go into Configuration Manager --> Information Fields
2. Select the field that isn't required for searches
3. Click the Edit button
4. Uncheck the Enable for Search Index box
5. Repeat the previous steps for the other unneeded fields
6. Rebuild the search index
7. Run the select ctx_report.create_index_script again and confirm that the field or fields are no longer marked as an SDATA section

NOTE: There is a fixed limit of 32 SDATA sections that can be present at one time. This limitation of Oracle Text has been solved as of database version 12.1.0.1.0.  This fix has also been backported to version 11.2.0.3.0.  It's also included in the 11.2.0.4.0 patchset for the database. See Note 1562142.1.
After upgrading or patching the database to raise this limit, there is another change needed for WCC to recognize the new limit.  See the Note:1607548.1

No comments:

Post a Comment