`
piziwang
  • 浏览: 236482 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
文章列表
转载自:http://onjava.com/lpt/a/3273   Lucene is a free text-indexing and -searching API written in Java. To appreciate indexing techniques described later in this article, you need a basic understanding of Lucene's index structure. As I mentioned in the previous article in this series , a typ ...
Lucene检索高亮显示,直接上代码,使用了林良益的IKAnalyzer:       创建的索引: import java.io.File; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.In ...
1. Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream   2. NoClassDefFoundError: com/sun/activation/registries/LogSupport      这两个问题都是因为 j2ee 5 和我们下载的 javamail 版本不一致造成的。         用rar打开 X:/Program Files/MyEclipse ...
问题: 目前索引里面已经有1000多万的数据了,现在需要每几分钟就增量得添加新的内容到索引中。 但是,我发现新加入索引后,整个索引结构都要重新调整。非常耗时(长达半个小时)。 不知道大家有没有什么比较好的办法,加快这个过程? 回答: 我觉得用lucene做,一个原则索引里面尽量少存储,索引文件小了,optimize要移动的数据块也小。 还有Lucene实在不适合做实时,有一个办法,将新索引建在内存中,新建在内存上的searcher与硬盘索引searcher合并为 MutliSearcher提供给前端搜索,内存到达一定量时再后台合并到主索 ...
熟练window对象的open、close、alert、confirm、prompt、setTimeout、clearTimeout、setInterval、clearInterval、moveBy、resizeBy、scrollBy方法的使用 掌握window对象的moveTo、resizeTo、scrollTo、print方法的使用 熟练掌握window对象的status、location、name、self、 ...
一个不错的js的RIA 框架组件:http://qooxdoo.org/demo
java 转换图片为字符串,将字符串转换成图片显示, 该方法只适用于比较小的图片传输,50K以内: try{ // 将图片转换成字符串 File imgFile = new File("f:\\Vista.png"); FileInputStream fis = new FileInputStream( imgFile ); byte[] bytes = new byte[fis.available()]; fis.read(bytes); fis.close(); String imgStr = byte ...
二进制转换成字符串: // 二进制转字符串 public static String byte2hex(byte[] b) { StringBuffer sb = new StringBuffer(); String tmp = ""; for (int i = 0; i < b.length; i++) { tmp = Integer.toHexString(b[i] & 0XFF); if (stmp.length() == 1){ sb.append("0" + t ...
当我们插入一条数据的时候,我们很多时候都想立刻获取当前插入的主键值返回以做它用。我们通常的做法有如下几种:   1. 先 select max(id) +1 ,然后将+1后的值作为主键插入数据库; 2. 使用特定数据库的 auto_increment 特性,在插入数据完成后,使用 select max(id) 获取主键值; 3. 对于Oracle,使用 sequence 获取值。   对于以上3种方法都无法绝对保证在高并发情况下的操作的原子性。   现记录以下几种获取数据库主键值方法:   1. 数据库原生支持的sql方法:      SQLServer: ...
1. replaceAll 不区分大小写替换字符: String str = "A2beDEa2343"; String s = str.replaceAll("(?u)a2", "*"); // 输出结果: *beDE*343   2. 不区分大小写提取字符中想要的字符 // 提取字符串中的“a2” String str = "A2234a2bdeda22"; /** * str = "A2D3343A2a2eaa2a2a2"; * 如果想 ...
function filterInt(evt){ evt = evt || window.event; var b = evt.keyCode || evt.which; return(b>=48&&b<=57)||b==44||b==45; } function filterFloat( evt ){ evt = evt || window.event; var b = evt.keyCode || evt.which; var _el = evt.srcElement || evt.target; ...
摘自:wangtao的spring+proxool解决方法: package cn.wt.listener; import java.io.File; import java.util.Enumeration; import java.util.Properties; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import org.apache.commons.lo ...
1.什么是OpenCV (来自Baidu百科)          OpenCV是Intel资助的开源计算机视觉库。它由一系列 C 函数和少量 C++ 类构成,实现了图像处理和计算机视觉方面的很多通用算法。          OpenCV 拥有包括 300 多个C函数的跨平台的中、高层 API。它不依赖于其它的外部库——尽管也可以使用某些外部库。OpenCV 对非商业应用和商业应用都是免费(FREE)的。OpenCV 为Intel&reg; Integrated Performance Primitives (IPP) 提供了透明接口。 这意味着如果有为特定处理器优化的的 ...
$(document).keypress(function(e) { switch(e.which) { // user presses the "a" case 97: showViaKeypress("#home"); break; // user presses the "s" key case 115: showViaKeypress("#about"); break; // user pre ...
RSS java 开源Rome jar 包 :  https://rome.dev.java.net/   ROME is an set of open source Java tools for parsing, generating and publishing RSS and Atom feeds.    
Global site tag (gtag.js) - Google Analytics