我在学习Lucene的时候,得到的结果跟想象中的不一样,请各位给点意见
先插入一写数据到数据库 tb_pu_user 表中,程序如下:    public void insertDB() throws ClassNotFoundException, SQLException{
     Connection conn = new DBUtil().getConnection();
     PreparedStatement pst = conn.prepareStatement("insert into TB_PU_USER(V_CODE,V_NAME,V_ADDR)values(?,?,?)");
     PreparedStatement pst1 = conn.prepareStatement("insert into tb_pu_order(N_ORDERID,V_CODE,N_MONEY)values(?,?,?)");
     long starttime =  System.currentTimeMillis();
    
     try{
         //打开事物
         conn.setAutoCommit(false);
         //truncate table tb_pu_user
         //truncate table tb_pu_order
        
         for (int i=0; i<20000; i++  ){
        
             pst.setString(1, "code"+i);
             pst.setString(2, "name"+i);
             pst.setString(3, "addr"+i);
             
             pst.execute();
         }
        
           for( int j=0; j<20000; j++ ){
            pst1.setLong(1, j);
            pst1.setString(2, "code"+j);
            pst1.setLong(3, j);
         
            pst1.execute();
           }         conn.commit();
        
         long endtime =  System.currentTimeMillis();
         System.out.println("花费的时间为: "+ new Time(endtime-starttime));
        
     }catch(Exception ex){
     ex.printStackTrace();
     conn.rollback();
     }
     finally{
     if( pst1 != null ){
     pst1.close();
     }
    
     if( pst != null ){
     pst.close();
     }
    
     if( conn != null ){
     conn.close();
     }
     }
    
    }
    
  2:创建索引
   
public CreateIndex(){}
public void CreateIndexTest() throws IOException, ClassNotFoundException, SQLException{
FSDirectory fsd = FSDirectory.getDirectory("C:\\indexDir");
StandardAnalyzer analyzer = new StandardAnalyzer();
IndexWriter iWriter = new IndexWriter (fsd, analyzer, true);
Document document = new Document();
String query = "  select * from tb_pu_user t where rownum < 2000 ";
Connection conn = new DBUtil().getConnection();
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(query); while(rs.next()){
document.add(new Field("VCODE",rs.getString("V_CODE"),Field.Store.YES,Field.Index.UN_TOKENIZED));
iWriter.addDocument(document);
}
iWriter.optimize();
iWriter.close();

System.out.println(" 创建索引完成... ");
}

3: 全文搜索    public void serach(String q) throws CorruptIndexException, IOException, ParseException{
     long startdate =new Date().getTime();
     IndexSearcher searcher = new IndexSearcher("C:\\indexDir");
     QueryParser queryParser = new QueryParser("VCODE", new StandardAnalyzer());
     Query query = queryParser.parse(q);
     Hits hits = searcher.search(query);        System.out.println("找到了"+hits.length()+"个结果");
        for(int i=0; i<hits.length(); i++ ){
            Document d = hits.doc(i);
            String VCODE = d.get("VCODE");
            System.out.println(i+"--->"+VCODE);
        }
        
        long enddate =new Date().getTime();
        System.out.println("花费时间:"+(double)(enddate-startdate)/1000+"秒");
    }
   
    测试:
public class TestLucene {
    public static void main(String[] argc) throws IOException, ClassNotFoundException, SQLException, ParseException{
     //生成测试数据
     InsertDBTest idb = new InsertDBTest();
     idb.insertDB();
    
     //创建索引
     CreateIndex cIndex = new CreateIndex();
     cIndex.CreateIndexTest();
    
    
     //查询索引
     SerachIndex sIndex = new SerachIndex();
     //参数是要查找的数据
     sIndex.serach("code0");
    
    
    }
}    但是得到的结果大失望,如果查询 code0 它就打印出  
查找的是:  code0
找到了1999个结果
0--->codedddd
1--->codedddd
2--->codedddd
3--->codedddd
4--->codedddd
5--->codedddd
6--->codedddd
7--->codedddd
8--->codedddd
....
我想应该查询出一个才对啊,请问高手们,这个是为什么?