Program: 170678
Project: 170678
Buggy source:
public List<Blog> searchBlog(Integer pageStart,String q,Integer pagehits) throws Exception {
  dir=FSDirectory.open(Paths.get("String_Node_Str"));
  IndexReader reader=DirectoryReader.open(dir);
  IndexSearcher search=new IndexSearcher(reader);
  ScoreDoc lastBottom=null;
  BooleanQuery.Builder booleanQuery=new BooleanQuery.Builder();
  SmartChineseAnalyzer analyzer=new SmartChineseAnalyzer();
  QueryParser parser1=new QueryParser("String_Node_Str",analyzer);
  Query query1=parser1.parse(q);
  QueryParser parser2=new QueryParser("String_Node_Str",analyzer);
  Query query2=parser2.parse(q);
  booleanQuery.add(query1,BooleanClause.Occur.SHOULD);
  booleanQuery.add(query2,BooleanClause.Occur.SHOULD);
  TopDocs hits=search.searchAfter(lastBottom,booleanQuery.build(),pagehits);
  pageStart+=hits.scoreDocs.length;
  lastBottom=hits.scoreDocs[hits.scoreDocs.length - 1];
  QueryScorer scorer=new QueryScorer(query1);
  Fragmenter fragmenter=new SimpleSpanFragmenter(scorer);
  SimpleHTMLFormatter simpleHTMLFormatter=new SimpleHTMLFormatter("String_Node_Str","String_Node_Str");
  Highlighter highlighter=new Highlighter(simpleHTMLFormatter,scorer);
  highlighter.setTextFragmenter(fragmenter);
  List<Blog> blogIndexList=new LinkedList<>();
  for (  ScoreDoc scoreDoc : hits.scoreDocs) {
    Document doc=search.doc(scoreDoc.doc);
    Blog blog=new Blog();
    blog.setBlogid(Integer.parseInt(doc.get(("String_Node_Str"))));
    blog.setCreateAt(DateTime.parse(doc.get("String_Node_Str")).toString());
    blog.setImageurl(doc.get("String_Node_Str"));
    blog.setCategoryid(Integer.parseInt(doc.get("String_Node_Str")));
    blog.setHits(Integer.parseInt(doc.get("String_Node_Str")));
    String title=doc.get("String_Node_Str");
    String content=doc.get("String_Node_Str");
    if (title != null) {
      TokenStream tokenStream=analyzer.tokenStream("String_Node_Str",new StringReader(title));
      String hTitle=highlighter.getBestFragment(tokenStream,title);
      if (StringUtil.isEmpty(hTitle)) {
        blog.setTitle(title);
      }
 else {
        blog.setTitle(hTitle);
      }
    }
    if (content != null) {
      TokenStream tokenStream=analyzer.tokenStream("String_Node_Str",new StringReader(content));
      String hContent=highlighter.getBestFragment(tokenStream,content);
      System.out.println(hContent);
      if (StringUtil.isEmpty(hContent)) {
        if (content.length() <= 400) {
          blog.setSummary(content);
        }
 else {
          blog.setSummary(content.substring(0,400));
        }
      }
 else {
        blog.setSummary(hContent);
      }
    }
    blogIndexList.add(blog);
  }
  return blogIndexList;
}

Fixed version (ground truth):
/** 
 * 首先是对标题进行查找，然后对文章内容进行查找
 * @param pageStart
 * @param q
 * @param pagehits
 * @return
 * @throws Exception
 */
public List<Blog> searchBlog(Integer pageStart,String q,Integer pagehits) throws Exception {
  dir=FSDirectory.open(Paths.get("String_Node_Str"));
  IndexReader reader=DirectoryReader.open(dir);
  IndexSearcher search=new IndexSearcher(reader);
  ScoreDoc lastBottom=null;
  BooleanQuery.Builder booleanQuery=new BooleanQuery.Builder();
  SmartChineseAnalyzer analyzer=new SmartChineseAnalyzer();
  QueryParser parser1=new QueryParser("String_Node_Str",analyzer);
  Query query1=parser1.parse(q);
  QueryParser parser2=new QueryParser("String_Node_Str",analyzer);
  Query query2=parser2.parse(q);
  booleanQuery.add(query1,BooleanClause.Occur.SHOULD);
  booleanQuery.add(query2,BooleanClause.Occur.SHOULD);
  TopDocs hits=search.searchAfter(lastBottom,booleanQuery.build(),pagehits);
  QueryScorer scorer=new QueryScorer(query1);
  Fragmenter fragmenter=new SimpleSpanFragmenter(scorer);
  SimpleHTMLFormatter simpleHTMLFormatter=new SimpleHTMLFormatter("String_Node_Str","String_Node_Str");
  Highlighter highlighter=new Highlighter(simpleHTMLFormatter,scorer);
  highlighter.setTextFragmenter(fragmenter);
  List<Blog> blogIndexList=new LinkedList<>();
  for (  ScoreDoc scoreDoc : hits.scoreDocs) {
    Document doc=search.doc(scoreDoc.doc);
    Blog blog=new Blog();
    blog.setBlogid(Integer.parseInt(doc.get(("String_Node_Str"))));
    blog.setCreateAt(DateTime.parse(doc.get("String_Node_Str")).toString());
    blog.setImageurl(doc.get("String_Node_Str"));
    blog.setCategoryid(Integer.parseInt(doc.get("String_Node_Str")));
    blog.setHits(Integer.parseInt(doc.get("String_Node_Str")));
    String title=doc.get("String_Node_Str");
    String content=doc.get("String_Node_Str");
    if (title != null) {
      TokenStream tokenStream=analyzer.tokenStream("String_Node_Str",new StringReader(title));
      String hTitle=highlighter.getBestFragment(tokenStream,title);
      if (StringUtil.isEmpty(hTitle)) {
        blog.setTitle(title);
      }
 else {
        blog.setTitle(hTitle);
      }
    }
    if (content != null) {
      TokenStream tokenStream=analyzer.tokenStream("String_Node_Str",new StringReader(content));
      String hContent=highlighter.getBestFragment(tokenStream,content);
      if (StringUtil.isEmpty(hContent)) {
        if (content.length() <= 400) {
          blog.setSummary(content);
        }
 else {
          blog.setSummary(content.substring(0,400));
        }
      }
 else {
        blog.setSummary(hContent);
      }
    }
    blogIndexList.add(blog);
  }
  return blogIndexList;
}