This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 244432 - Add a public access to CategoryResult.MAX_RESULTS and .ALL_MAX_RESULTS
Summary: Add a public access to CategoryResult.MAX_RESULTS and .ALL_MAX_RESULTS
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Quick Search (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-12 05:29 UTC by arittner
Modified: 2014-05-23 14:45 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed Patch (14.48 KB, patch)
2014-05-23 14:45 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description arittner 2014-05-12 05:29:29 UTC
The SearchRequest Class should expose the values from CategoryResult.MAX_RESULTS and/or *.ALL_MAX_RESULTS to optimize queries for the SearchProvider.

Sometimes it would be useful to know the real search result limits to prepare queries (e.g. database select optimizations, like the FIRST or ROWS clause, JDBC-setFetchSize, ...).

Example:

public class PersonNameSearch implements SearchProvider {

  @Override
  public void evaluate(SearchRequest request, SearchResponse response) {
        
    String req = request.getText();
    int limit = request.getResultLimit(); // proposal

    ...

    PreparedStatement stmt = ...

    stmt.setFetchSize (limit);
Comment 1 Jaroslav Havlin 2014-05-23 14:45:15 UTC
Created attachment 147414 [details]
Proposed Patch

Please check the attached patch. If the changes seem ok to you, I'll add unit tests and start an API review.
Thank you for reporting.