Re: SQL query for selecting the Top 100 records (408 Views)
Reply
Frequent Advisor
venkat_m
Posts: 73
Registered: ‎05-25-2010
Message 1 of 4 (408 Views)

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();

Honored Contributor
EWillsey
Posts: 1,922
Registered: ‎04-20-2010
Message 2 of 4 (408 Views)

Re: SQL query for selecting the Top 100 records

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

Frequent Advisor
venkat_m
Posts: 73
Registered: ‎05-25-2010
Message 3 of 4 (408 Views)

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?

Honored Contributor
EWillsey
Posts: 1,922
Registered: ‎04-20-2010
Message 4 of 4 (408 Views)

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.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.