org.apache.lucene.queryParser.ParseException.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.apache.lucene.queryParser.ParseException.printStackTrace()方法的一些代码示例,展示了ParseException.printStackTrace()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ParseException.printStackTrace()方法的具体详情如下:
包路径:org.apache.lucene.queryParser.ParseException
类名称:ParseException
方法名:printStackTrace

ParseException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: com.github.monnetproject/clesa

public TopScoreDocCollector search(String queryString, int lucHits, String fieldName, Analyzer analyzer) {
  queryString = QueryParser.escape(queryString.trim());        
  if(queryString.equalsIgnoreCase("")) 
    return null;
  Query query = null;
  try {
    QueryParser queryParser = new QueryParser(Version.LUCENE_36, fieldName, analyzer);			
    query = queryParser.parse(queryString);
  } catch (ParseException e) {
    e.printStackTrace();
  }                        
  return search(query, lucHits);	
}

代码示例来源:origin: com.github.monnetproject/clesa

public TopScoreDocCollector multiFieldSearch(String[] queryStrings, String[] fields, BooleanClause.Occur[] flags, Analyzer analyzer, int lucHits){		
  escapeStrings(queryStrings);
  Query query = null;
  try {
    query = MultiFieldQueryParser.parse(Version.LUCENE_36, queryStrings, fields, flags, analyzer);            
  } catch (ParseException e) {
    e.printStackTrace();
  }
  return search(query, lucHits);
}

代码示例来源:origin: wks/ik-analyzer

/**
 * 组装Lucene Query
 * 处理关键字紧凑搜索
 * @param elements
 * @return
 */
private Query luceneQueryParse(String fieldName , String keyword){
  //截取头部^尾部$
  keyword = keyword.substring(1 , keyword.length() - 1);
  String luceneExp = fieldName + ":\"" + keyword + "\"";
  QueryParser luceneQueryParser = new QueryParser(Version.LUCENE_30 , "" ,new IKAnalyzer());
  try {
    Query lucenceQuery = luceneQueryParser.parse(luceneExp);
    return lucenceQuery;
  } catch (ParseException e) {
    e.printStackTrace();
  }                                
  return null;			
}

代码示例来源:origin: pebbleblog/pebble

pe.printStackTrace();
 searchResults.setMessage("Sorry, but there was an error. Please try another search");
} catch (Exception e) {

相关文章