Project

General

Profile

Revision 1349

Added by Jing Tao almost 18 years ago

Change the code for percentage search.

View differences:

src/edu/ucsb/nceas/metacat/DBQuery.java
279 279
          // if there are returndocs to match, backtracking can be performed
280 280
          // otherwise, just return the document that was hit
281 281
          Vector returndocVec = qspec.getReturnDocList();
282
          if (returndocVec.size() != 0 && !returndocVec.contains(doctype))
282
          if (returndocVec.size() != 0 && !returndocVec.contains(doctype) 
283
              && !qspec.isPercentageSearch())
283 284
          { 
284
            MetaCatUtil.debugMessage("Back tracing now...", 50);
285
            MetaCatUtil.debugMessage("Back tracing now...", 20);
285 286
            String sep = util.getOption("accNumSeparator");
286 287
            StringBuffer btBuf = new StringBuffer();
287 288
            btBuf.append("select docid from xml_relation where ");
......
369 370
            }
370 371
            npstmt.close();
371 372
            btrs.close();
372
          } else {
373
          } 
374
          else if (returndocVec.size() != 0 && returndocVec.contains(doctype)) 
375
          {
373 376
          
374 377
            document = new StringBuffer();
375 378

  
......
419 422
            //pstmt.close();
420 423
            double extendedQueryStart = System.currentTimeMillis()/1000;
421 424
            String extendedQuery = qspec.printExtendedSQL(doclist.toString());
422
            MetaCatUtil.debugMessage("Extended query: "+ extendedQuery, 30);
425
            MetaCatUtil.debugMessage("Extended query: "+ extendedQuery, 50);
423 426
            pstmt = dbconn.prepareStatement(extendedQuery);
424 427
            //increase dbconnection usage count
425 428
            dbconn.increaseUsageCount(1);

Also available in: Unified diff