´«ÖDz¥¿ÍJAVAÅàѵ2010 4 29Lucene×ܽá
´«ÖDz¥¿ÍJAVAÅàѵ2010-4-29Lucene×ܽá
½ñÌìÐÄÇé²»´í£¬±±¾©µÄÌìÖÕÓÚ¶³öÁËÌ«ÑôÄÇ»¨¶ùÒ»°ãµÄÁ³µ°¶ù£¬ÐÄÇéÒ²²»ÓÉÒò´Ë¶øÉú³öϲÔã¬ÈË×ÜÊÇ»áÊÜ»·¾³µÄÓ°Ï죬ÏÂÎç»ØÀ´ÐÂÎÅÖÐÎÒ¿´µ½¹ã¶«ÄDZ߷¢ÉúµÄÊ£¬ÎÒÐÄÇé˵²»³öÀ´µÄ³ÁÖØ£¬ÎªÊ²Ã´ÕâЩÈ˲»ºÃºÃÕäϧÉú»îÄØ£¿ÎªÊ²Ã´ÒªÄÃÄÇЩÎÞ¹¼µÄСº¢×Ó³öÆø£¬°¦£¡
Éú»îÒÀȻҪ¼ÌÐø£¬Ñ§Ï°ÒÀ¾ÉÒª¼ÌÐø£¬¾ÍÏñÿÌ춼Ҫµ½×â·¿ÍâÃæµÄСµê´ò°×Ã×·¹ÁË£¬ËäȻζµÀ²»ÊǺܺ㬵«È´ÊDz»¿ÉȱÉÙµÄÒ»²¿·Ö£¬Éú»î±¾À´¾ÍÈç´Ë£¬ÎÒÇÞÊҵĸçÃÇÌìÌ춼³Ô°×ÂøÍ·£¬ÎҾͲ»Çå³þÁË£¬¸çÃÇ£¬ÄãΪʲô¾ÍÄÇôϲ»¶³ÔÄÇÂøÍ·£¬¸çÃÇȴ˵£¬ÎÒ³ÔÃ×·¹³ÔÁ˶Ç×ÓÍ´£¬ÕæÊÇЦµ¿ÁË´óÑÀÁË£¬ËûÒ»ÌìÈý¶Ù£¬¶Ù¶Ù³ÔÂøÍ·¡£¾ÍÏñÎÒÒ»ÌìÒª³ÔÈý´Î°×Ã×·¹Ò»Ñù£¬²»¹ÜÎÒÔõôŬÁ¦µÄÏëÈ¥³Ô¼¸¸öÂøÍ·£¬µ«ÎÒ·¢ÏÖ£¬ÎҸı䲻ÁË£¬ÎÒ¶àÄêÀ´ÐγɵÄÏ°¹ß£¬»¹ÊÇÃ×·¹ºÃ£¬¸çÃÇÈÏΪÂøÍ·ºÃ£¬ËÒ²¸Ä±ä²»ÁËË¡£
ÌÀÑô¹âÀÏʦ£¬ÎÒÖ»ÄÜ˵ÊÇÈËÈçÆäÃû£¬ÕæµÄÊǺÜÑô¹âµÄÒ»ÃûÀÏʦ¡£´ÓËûµÄÑù×ÓÀ´ÍƶϵĻ°£¬Ëû¾ø¶ÔÊÇÎÒÃÇѧУ×îÄêÇáµÄһλÀÏʦ£¬ºÍÎÒÃÇ°àµÄͬѧ²î²»¶à´ó£¬ÈËÈçÆäÃû£¬Ñô¹âÈ÷ÍÑ£¬ÉùÒôÈ´·Ç³£ÓдÅÐÔ£¬Èç¹ûÊÇÅ®Éú£¬¿ÉÒԺܿì¾Í±»ËûµÄÉùÒôÃÔסÁË¡£Lucene£¬È«ÎÄËÑË÷ÒýÇ棬ÎÒÒ»±éÓÖÒ»±éµÄÒ²ÔÚËÑË÷£¬×ܽá½ñÌìËùѧµÄ֪ʶµã£º
1.ʹÓÃLucene¾ÍÊÇҪʵÏÖÕ¾ÄÚËÑË÷£¬³£Óõķ½Ê½¾ÍÊÇ´ÓÊý¾Ý¿âÖиù¾ÝÊäÈëÄÚÈݽøÐÐËÑË÷£¬µ«ÊÇÕâÑùµÄËÙ¶ÈÊǷdz£µÄÂýµÄ¡£µ«ÊÇͨ¹ýLucene¾Í¿ÉÒÔ´ÓË÷Òý¿âÖпìËٵļìË÷Ïà¹ØµÄ£¬×îÖ÷ÒªµÄ¾ÍÊÇ·ûºÏÓû§ÒªÇóµÄÊý¾Ý¡£
2.ÎÒÃǵŤ×÷¾ÍÊÇ×÷ÓòÙ×÷Lucene ÌṩµÄAPI²Ù×÷Ë÷Òý¿âÖеÄÊý¾Ý£¬ÒÔ¼°Î¬»¤ÆäÖеÄÊý¾Ý¡£
Ë÷Òý¿â¹ÜÀí£¬Ê¹ÓÃIndexWriter¡£ÓÃËû¿ÉÒÔÔÚË÷Òý¿âÖÐÔö¼Ó¡¢É¾³ý¡¢¸üÐÂË÷ÒýÊý¾Ý£¬¶ÔÓ¦µÄ·½·¨Îª£ºaddDocument()¡¢deleteDocuments()¡¢updateDocument()¡£Ò²¿ÉÒÔ½øÐÐË÷Òý¿âµÄһЩÆäËûÓйصÄÐÞ¸ÄÓëÓÅ»¯µÄ²Ù×÷¡£
ÔÚË÷Òý¿âÖÐËÑË÷£¬Ê¹ÓÃIndexSearcher¡£¶ÔÓ¦µÄ·½·¨Îªsearch()¡£
¸ÅÄ
1.Directory Ë÷Òý¿â¡£ËùÓеÄÊý¾ÝÒ²ÊÇÒÔÎļþµÄÐÎʽ´æÔÚË÷Òý¿âÖУ¬ÆäʵË÷Òý¿âÒ²¾ÍÊÇÒ»¸öÎļþ¼Ð£¬ÆäÖд¢ÁËÐíÐí¶à¶àµÄÊý¾Ý¡£ÎÒÃDz»ÓÃÖ±½ÓÈ¥¸ÄÎļþÖеÄÊý¾Ý£¬ÊÇͨ¹ýºÍÒÀÀµÓÚLuceneÌṩµÄAPI£¬¾ÍÏñÎÒÃÇʹÓÃSQLÓï¾äÈ¥²Ù×÷Êý¾Ý¿âÒ»Ñù¡£
´´½¨Óï¾ä£ºDirectory d = FSDirectory.open(new File("./"));
2.Analyzer(·ÖÎö)
(·ÖÎöÆ÷),ÎÒ¶Ô·ÖÎöÆ÷µÄÀí½â²»ÊǺܺá£ÔÚ´´½¨¡¢Ð޸ġ¢É¾³ý¡¢²éѯʱ¶¼ÒªÓõ½£¬ÌرðÊÇÔÚÒ»¸öÏîÄ¿ÖУ¬Äã²ÉÓÃʲôÑùµÄ·ÖÎö½øÐÐÌí¼ÓDocument¾ÍÒª²ÉÓÃͬÑùµÄ·ÖÎöÆ÷½øÐÐÆäËüµÄ²Ù×÷¡£ÒýÓÃÒ»¶ÎÒ
Ïà¹ØÎĵµ£º
ÎÊÌ⣺ÔÚ´æ´¢¹ý³ÌÖУ¬ÓÐʱ»áÓöµ½±È½Ï±ä̬µÄ¶«Î÷£¬ÈçÒ»¸ö´æ´¢¹ý³ÌÖÐÓÐoutput·µ»ØÖµ£¬ÓÐreturn·µ»ØÖµ£¬»¹ÓвéѯµÄ·µ»ØÖµTABLE£¬Óöµ½ÕâÑùµÄ´æ´¢¹ý³ÌÕæÊÇÓôÃÆ£¬Ò»´ÎÐÔ°ÑËùÓеķµ»Øֵȡ³öÀ´»¹ÕæµÄÓеãÂé·³¡£
1¡¢ Ê×ÏÈÀ´¿´Õâ¸ö´æ´¢¹ý³Ì°É
CREATE PROCEDURE ParaTest
@paraout varchar(20) ......
ºËÐÄÌáʾ£º±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬·Ö±ðÏêϸ½éÉÜÁËʹÓÃhttpºÍsocketÁ½ÖÖ·½·¨¡£ HttpConnection Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó°É£º Ö÷ÒªÓõ½µÄjava°ü£º javax.microedition.io.*; public String requestGET(String URLString,String URL) throws
±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬ ......
/*===================MXML´úÂë==================*/
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button label="²âÊÔArray" click="bk()"/>
<mx:Script>
<!--[CDATA[
import mx.collection ......
¡¡ÔÚJavaÓïÑÔÖУ¬ abstract class ºÍinterface ÊÇÖ§³Ö³éÏóÀඨÒåµÄÁ½ÖÖ»úÖÆ¡£ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄ ÃæÏò¶ÔÏóÄÜÁ¦¡£abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½ø ÐгéÏóÀඨÒåʱ¶ÔÓÚabstract classºÍinterfaceµÄÑ¡ÔñÏԵñȽÏËæ ......
(±¾ÎÄתÔØ)
ÔÎÄ£ºhttp://blog.csdn.net/thinkghoster/archive/2008/04/19/2307001.aspx
class
A
...
{
public
String show(D obj)
...
{
&nbs ......