SDK / API Support
Showing results for 
Search instead for 
Do you mean 

SQL query for selecting the Top 100 records

Frequent Advisor

SQL query for selecting the Top 100 records

Hi all, I have developed a web application using TRIM SDK 6.2.5 in which there is a global search feature which will search for the search keyword either in record title or document content. Though my code is able to search across the huge dataset perfectly, but it is taking more time for few keywords where there are more than 100 resultsets. Is there any way to restrict the SDK to show only the top 100 records? So that, I can put a message asking the end user to narrow down the search or add more kewords.

If there is no way to do this using TRIM SDK, Can I use the database.getRecordset to run sql query? But unfortunately, I don't know to write query as I don't understand the complete databse schema. Can any one give me clue on the SQL QUERY for the following TRIM SDK code..

RecordSearch rSearch = db.NewRecordSearch();                   
rSearch.AddDocumentContentClause(searchString);
rSearch.AddTitleWordClause(searchString);
rSearch.Or();

Object publicValue = "P";
Object priValue = "V";
rSearch.AddUserFieldClause(db.GetFieldDefinition("UType"),publicValue, publicValue);
rSearch.AddUserFieldClause(db.GetFieldDefinition("UType"),priValue,priValue);
rSearch.Or();
rSearch.And();

records = rSearch.GetRecords();

3 REPLIES
Honored Contributor

Re: SQL query for selecting the Top 100 records

Since you're using DCI search, this won't be possible.

Frequent Advisor

Re: SQL query for selecting the Top 100 records

Ya, I can understand that.

Just one more question, is there anyway thru TRIMmainObjectSearch (later when I upgrade to 7.1) I can do this?

Highlighted
Honored Contributor

Re: SQL query for selecting the Top 100 records

Highly unlikely since the DCI search is passed off to ISYS.... so executing anything manually with SQL Statements will be impossible.