- Timestamp:
- 2007-03-14T11:12:10+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
r13916 r13975 478 478 break; 479 479 } 480 481 480 482 481 // run the query … … 489 488 Element metadata_list = this.doc.createElement(GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 490 489 result.appendChild(metadata_list); 491 490 492 491 // Add a metadata element specifying the number of matching documents 493 492 long totalDocs = numDocsMatched(query_result); … … 502 501 int docs_returned = docs.length; 503 502 if (does_paging) { 504 int maxdocs = Integer.parseInt((String)params.get(MAXDOCS_PARAM)); 505 docs_returned = (maxdocs < (int)totalDocs ? maxdocs : (int)totalDocs); 503 String maxdocs_str = (String)params.get(MAXDOCS_PARAM); 504 if (maxdocs_str != null) { 505 int maxdocs = Integer.parseInt(maxdocs_str); 506 docs_returned = (maxdocs < (int)totalDocs ? maxdocs : (int)totalDocs); 507 } 506 508 } 507 509 GSXML.addMetadata(this.doc, metadata_list, "numDocsReturned", ""+docs_returned); 510 508 511 // add a metadata item to specify what actual query was done - eg if stuff was stripped out etc. and then we can use the query later, cos we don't know which parameter was the query 509 512 GSXML.addMetadata(this.doc, metadata_list, "query", query); … … 517 520 } 518 521 } 522 519 523 // Create a term list to store the term information, and add it 520 524 Element term_list = this.doc.createElement(GSXML.TERM_ELEM+GSXML.LIST_MODIFIER);
Note:
See TracChangeset
for help on using the changeset viewer.