隨筆-26  評(píng)論-111  文章-19  trackbacks-0

                  基于自己的興趣,利用業(yè)務(wù)時(shí)間在Lucene基礎(chǔ)上做的一個(gè)搜索框架,請(qǐng)大家多多指教。

          一、       
          介紹

          基于Lucene的全文檢索框架,提供快速方便的索引創(chuàng)建及查詢方式,并提供擴(kuò)展功能對(duì)框架進(jìn)行擴(kuò)展。

              項(xiàng)目地址:http://code.google.com/p/snoics-retrieval/

          二、        使用指南

          1、 環(huán)境要求

          Java1.5+

          Lucene 3.0.x+

          2、 加載

          通過(guò)RetrievalApplicationContext 載入配置參數(shù),創(chuàng)建實(shí)例,每個(gè)被創(chuàng)建出的RetrievalApplicationContext實(shí)例中都包含一個(gè)完整的、獨(dú)立的上下文環(huán)境。

          一般情況下,一個(gè)應(yīng)用只需要在啟動(dòng)時(shí)創(chuàng)建一個(gè)RetrievalApplicationContext實(shí)例,然后由整個(gè)應(yīng)用共享。

          有以下幾種方式創(chuàng)建RetrievalApplicationContext實(shí)例:

          以默認(rèn)的方式,通過(guò)讀取classpath下的retrieval.properties配置文件創(chuàng)建

                             RetrievalApplicationContext retrievalApplicationContext=

                        new RetrievalApplicationContext(“c:""index”);

          使用配置文件的Properties實(shí)例加載

                             Properties properties=...

                             ...

                             RetrievalApplicationContext retrievalApplicationContext=

                     new RetrievalApplicationContext(properties,“c:""index”);

          讀取指定的配置文件創(chuàng)建,文件必須放在classpath

                             RetrievalApplicationContext retrievalApplicationContext=

                     new RetrievalApplicationContext(“app-retrieval.properties”,

          “c:""index”);

          通過(guò)構(gòu)建RetrievalProperties對(duì)象創(chuàng)建

                             RetrievalProperties retrievalProperties=…

                 …

                             RetrievalApplicationContext retrievalApplicationContext=

                     new RetrievalApplicationContext(retrievalProperties,

          “c:""index”);

          3、 參數(shù)配置

          默認(rèn)配置文件為classpath下的retrieval.properties,配置參數(shù)說(shuō)明如下

          LUCENE_PARAM_VERSION

          Lucene參數(shù),如果不設(shè)置則使用默認(rèn)值 LUCENE_30
          設(shè)置Lucene版本號(hào),將影響到索引文件格式及查詢結(jié)果

          LUCENE_20
          LUCENE_21
          LUCENE_22
          LUCENE_23
          LUCENE_24
          LUCENE_29
          LUCENE_30

          LUCENE_PARAM_MAX_FIELD_LENGTH

          Lucene參數(shù),如果不設(shè)置則使用默認(rèn)值 DEFAULT_MAX_FIELD_LENGTH=10000

          The maximum number of terms that will be indexed for a single field in a document.
          This limits the amount of memory required for indexing, so that collections with
          very large files will not crash the indexing process by running out of memory.
          This setting refers to the number of running terms, not to the number of different terms.

          Note: this silently truncates large documents, excluding from the index all terms
          that occur further in the document. If you know your source documents are large,
          be sure to set this value high enough to accomodate the expected size. If you set
          it to Integer.MAX_VALUE, then the only limit is your memory, but you should anticipate
          an OutOfMemoryError.

          By default, no more than DEFAULT_MAX_FIELD_LENGTH=10000 terms will be indexed for a field.

          LUCENE_PARAM_RAM_BUFFER_SIZE_MB

          Lucene 參數(shù),如果不設(shè)置,則使用默認(rèn)值 DEFAULT_RAM_BUFFER_SIZE_MB=16
          控制用于buffer索引文檔的內(nèi)存上限,如果buffer的索引文檔個(gè)數(shù)到達(dá)該上限就寫(xiě)入硬盤(pán),越大索引速度越快。

          Determines the amount of RAM that may be used for buffering added documents and
          deletions before they are flushed to the Directory. Generally for faster indexing
          performance it's best to flush by RAM usage instead of document count and use as
          large a RAM buffer as you can.

          When this is set, the writer will flush whenever buffered documents and deletions
          use this much RAM. Pass in DISABLE_AUTO_FLUSH to prevent triggering a flush due to
          RAM usage. Note that if flushing by document count is also enabled, then the flush
          will be triggered by whichever comes first.

          NOTE: the account of RAM usage for pending deletions is only approximate. Specifically,
          if you delete by Query, Lucene currently has no way to measure the RAM usage if
          individual Queries so the accounting will under-estimate and you should compensate by
          either calling commit() periodically yourself, or by using setMaxBufferedDeleteTerms
          to flush by count instead of RAM usage (each buffered delete Query counts as one).

          NOTE: because IndexWriter uses ints when managing its internal storage, the absolute
          maximum value for this setting is somewhat less than 2048 MB. The precise limit depends on
          various factors, such as how large your documents are, how many fields have norms,
          etc., so it's best to set this value comfortably under 2048.

          The default value is DEFAULT_RAM_BUFFER_SIZE_MB=16.

          LUCENE_PARAM_MAX_BUFFERED_DOCS

          Lucene 參數(shù),如果不設(shè)置,則使用默認(rèn)值
          和LUCENE_PARAM_RAM_BUFFER_SIZE_MB這兩個(gè)參數(shù)是可以一起使用的,一起使用時(shí)只要有一個(gè)觸發(fā)條件
          滿足就寫(xiě)入硬盤(pán),生成一個(gè)新的索引segment文件

          Determines the minimal number of documents required before the buffered in-memory documents
          are flushed as a new Segment. Large values generally gives faster indexing.

          When this is set, the writer will flush every maxBufferedDocs added documents. Pass in
          DISABLE_AUTO_FLUSH to prevent triggering a flush due to number of buffered documents.
          Note that if flushing by RAM usage is also enabled, then the flush will be triggered by
          whichever comes first.

          Disabled by default (writer flushes by RAM usage).

          LUCENE_PARAM_MERGE_FACTOR

          Lucene 參數(shù),如果不設(shè)置,則使用默認(rèn)值 10
          MergeFactor 這個(gè)參數(shù)就是控制當(dāng)硬盤(pán)中有多少個(gè)子索引segments,MergeFactor這個(gè)不能設(shè)置太大,
          特別是當(dāng)MaxBufferedDocs比較小時(shí)(segment 越多),否則會(huì)導(dǎo)致open too many files錯(cuò)誤,甚至導(dǎo)致虛擬機(jī)外面出錯(cuò)。

          Determines how often segment indices are merged by addDocument(). With smaller values,
          less RAM is used while indexing, and searches on unoptimized indices are faster,
          but indexing speed is slower. With larger values, more RAM is used during indexing,
          and while searches on unoptimized indices are slower, indexing is faster. Thus larger
          values (> 10) are best for batch index creation, and smaller values (< 10) for indices
          that are interactively maintained.

          Note that this method is a convenience method: it just calls mergePolicy.setMergeFactor
          as long as mergePolicy is an instance of LogMergePolicy. Otherwise an IllegalArgumentException
          is thrown.

          This must never be less than 2. The default value is 10.

          LUCENE_PARAM_MAX_MERGE_DOCS

          Lucene 參數(shù),如果不設(shè)置,則使用默認(rèn)值 Integer.MAX_VALUE
          該參數(shù)決定寫(xiě)入內(nèi)存索引文檔個(gè)數(shù),到達(dá)該數(shù)目后就把該內(nèi)存索引寫(xiě)入硬盤(pán),生成一個(gè)新的索引segment文件,越大索引速度越快。

          Determines the largest segment (measured by document count) that may be merged with other segments.
          Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length
          of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

          The default value is Integer.MAX_VALUE.

          Note that this method is a convenience method: it just calls mergePolicy.setMaxMergeDocs as long as
          mergePolicy is an instance of LogMergePolicy. Otherwise an IllegalArgumentException is thrown.

          The default merge policy (LogByteSizeMergePolicy) also allows you to set this limit by net
          size (in MB) of the segment, using LogByteSizeMergePolicy.setMaxMergeMB.

          INDEX_MAX_FILE_DOCUMENT_PAGE_SIZE

          設(shè)置索引創(chuàng)建執(zhí)行參數(shù),如果不設(shè)置,則使用默認(rèn)值 20

          批量創(chuàng)建文件索引時(shí)每頁(yè)最大的文件索引文檔數(shù)量,
          即使在創(chuàng)建索引時(shí),通過(guò)API設(shè)置超過(guò)這個(gè)值的數(shù)量,也不會(huì)生效

          INDEX_MAX_INDEX_FILE_SIZE

          設(shè)置索引創(chuàng)建執(zhí)行參數(shù),如果不設(shè)置,則使用默認(rèn)值 3145728(單位:字節(jié))

          創(chuàng)建文件索引時(shí),如果文件大小超過(guò)這里設(shè)置的限制的大小,則忽略該文件的內(nèi)容,不對(duì)文件內(nèi)容解析創(chuàng)建索引

          INDEX_MAX_DB_DOCUMENT_PAGE_SIZE

          設(shè)置索引創(chuàng)建執(zhí)行參數(shù),如果不設(shè)置,則使用默認(rèn)值 500

          批量創(chuàng)建數(shù)據(jù)庫(kù)索引時(shí),從數(shù)據(jù)庫(kù)中讀取的每頁(yè)數(shù)據(jù)最大記錄數(shù)
          即使在創(chuàng)建索引時(shí),通過(guò)API設(shè)置超過(guò)這個(gè)值的數(shù)量,也不會(huì)生效

          INDEX_DEFAULT_CHARSET

          設(shè)置索引創(chuàng)建執(zhí)行參數(shù),如果不設(shè)置,則使用默認(rèn)值 utf-8

          解析文本文件內(nèi)容時(shí)使用的默認(rèn)字符集

          QUERY_RESULT_TOP_DOCS_NUM

          設(shè)置索引檢索執(zhí)行參數(shù),如果不設(shè)置,則使用默認(rèn)值 3000

          查詢結(jié)果返回的最大結(jié)果集

          RETRIEVAL_EXTENDS_CLASS_FILE_CONTENT_PARSER_MANAGER

          Retrieval擴(kuò)展,如果不設(shè)置,則使用默認(rèn)值 com.snoics.retrieval.engine.index.create.impl.file.FileContentParserManager

          文件內(nèi)容解析管理器,對(duì)文件創(chuàng)建索引時(shí),通過(guò)該管理器對(duì)不同的文件類(lèi)型創(chuàng)建各自對(duì)應(yīng)的解析器對(duì)文件內(nèi)容進(jìn)行解析
          需要實(shí)現(xiàn)接口:com.snoics.retrieval.engine.index.create.impl.file.IFileContentParserManager

          RETRIEVAL_EXTENDS_CLASS_ANALYZER_BUILDER

          Retrieval擴(kuò)展,如果不設(shè)置,則使用默認(rèn)值 com.snoics.retrieval.engine.analyzer.CJKAnalyzerBuilder

          索引分詞器,內(nèi)置索引分詞器包括:
          com.snoics.retrieval.engine.analyzer.CJKAnalyzerBuilder(默認(rèn))
          com.snoics.retrieval.engine.analyzer.IKCAnalyzerBuilder(中文分詞強(qiáng)烈推薦)
          com.snoics.retrieval.engine.analyzer.StandardAnalyzerBuilder
          com.snoics.retrieval.engine.analyzer.ChineseAnalyzerBuilder

          需要實(shí)現(xiàn)接口:com.snoics.retrieval.engine.analyzer.IRAnalyzerBuilder

          RETRIEVAL_EXTENDS_CLASS_HEIGHLIGHTER_MAKER

          Retrieval擴(kuò)展,如果不設(shè)置,則使用默認(rèn)值 com.snoics.retrieval.engine.query.formatter.HighlighterMaker

          對(duì)查詢結(jié)果內(nèi)容進(jìn)行高亮處理

          需要實(shí)現(xiàn)接口:com.snoics.retrieval.engine.query.formatter.IHighlighterMaker

          RETRIEVAL_EXTENDS_CLASS_DATABASE_INDEX_ALL

          Retrieval擴(kuò)展,如果不設(shè)置,則使用默認(rèn)值 com.snoics.retrieval.engine.index.all.impl.DefaultRDatabaseIndexAllImpl

          對(duì)查詢結(jié)果內(nèi)容進(jìn)行高亮處理

          需要繼承抽象類(lèi):com.snoics.retrieval.engine.index.all.impl.AbstractDefaultRDatabaseIndexAll
          或直接實(shí)現(xiàn)接口:com.snoics.retrieval.engine.index.all.IRDatabaseIndexAll

          4、 索引

          4.1、初始化索引

                          retrievalApplicationContext

          .getFacade()

          .initIndex(new String[]{"DB","FILE"});

          4.2、提供5種方式創(chuàng)建索引

          以普通方式創(chuàng)建索引

                 RFacade facade=retrievalApplicationContext.getFacade();

                

                 NormalIndexDocument normalIndexDocument=

          facade.createNormalIndexDocument(false);

                

                 RDocItem docItem1=new RDocItem();

                 docItem1.setContent("搜索引擎");

                 docItem1.setName("KEY_FIELD");

                 normalIndexDocument.addKeyWord(docItem1);

                 RDocItem docItem2=new RDocItem();

                 docItem2.setContent("速度覅藕斷絲連房?jī)r(jià)多少了咖啡卡拉圣誕節(jié)");

                 docItem2.setName("TITLE_FIELD");

                 normalIndexDocument.addContent(docItem2);

                 RDocItem docItem3=new RDocItem();

                 docItem3.setContent("哦瓦爾卡及討論熱離開(kāi)家");

                 docItem3.setName("CONTENT_FIELD");

                 normalIndexDocument.addContent(docItem3);

                 IRDocOperatorFacade docOperatorFacade=

          facade.createDocOperatorFacade();

                

                 docOperatorFacade.create(normalIndexDocument);

          對(duì)單條數(shù)據(jù)庫(kù)記錄內(nèi)容創(chuàng)建索引

                 IRDocOperatorFacade docOperatorHelper=

          retrievalApplicationContext

          .getFacade()

          .createDocOperatorFacade();

                

                 String tableName="TABLE1";

                 String recordId="849032809432490324093";

                

                 DatabaseIndexDocument databaseIndexDocument=

          retrievalApplicationContext

          .getFacade()

          .createDatabaseIndexDocument(false);

                

                 databaseIndexDocument.setIndexPathType("DB");

                 databaseIndexDocument.setIndexInfoType("TABLE1");

                

                 databaseIndexDocument.setTableNameAndRecordId(tableName,

          recordId);

                 RDocItem docItem1=new RDocItem();

                 docItem1.setName("TITLE");

                 docItem1.setContent("SJLKDFJDSLK F");

                

                 RDocItem docItem2=new RDocItem();

                 docItem2.setName("CONTENT");

                 docItem2.setContent("RUEWOJFDLSKJFLKSJGLKJSFLKDSJFLKDSF");

                

                 RDocItem docItem3=new RDocItem();

                 docItem3.setName("field3");

                 docItem3.setContent("adsjflkdsjflkdsf");

                

                 RDocItem docItem4=new RDocItem();

                 docItem4.setName("field4");

                 docItem4.setContent("45432534253");

                

                 RDocItem docItem5=new RDocItem();

                 docItem5.setName("field5");

                 docItem5.setContent("87987yyyyyyyy");

                

                 RDocItem docItem6=new RDocItem();

                 docItem6.setName("field6");

                 docItem6.setContent("87987yyyyyyyy");

                

                 databaseIndexDocument.addContent(docItem1);

                 databaseIndexDocument.addContent(docItem2);

                 databaseIndexDocument.addContent(docItem3);

                 databaseIndexDocument.addContent(docItem4);

                 databaseIndexDocument.addContent(docItem5);

                 databaseIndexDocument.addContent(docItem6);

                

                 docOperatorHelper.create(databaseIndexDocument);

          對(duì)單個(gè)文件內(nèi)容及文件信息創(chuàng)建索引

                 IRDocOperatorFacade docOperatorHelper=

          retrievalApplicationContext

          .getFacade()

          .createDocOperatorFacade();

                

                 FileIndexDocument fileIndexDocument=

          retrievalApplicationContext

          .getFacade()

          .createFileIndexDocument(false,"utf-8");

                 fileIndexDocument.setFileBasePath("c:""doc");

                 fileIndexDocument.setFileId("fileId_123");

                 fileIndexDocument.setFile(new File("c:""doc""1.doc"));

                 fileIndexDocument.setIndexPathType("FILE");

                 fileIndexDocument.setIndexInfoType("SFILE");

                

                 docOperatorHelper.create(fileIndexDocument,3*1024*1024);

                 

          對(duì)數(shù)據(jù)庫(kù)記錄進(jìn)行批量創(chuàng)建索引

                 String tableName = "TABLE1";

                 String keyField = "ID";

                 String sql = "SELECT ID,"

          + "TITLE,"

          + "CONTENT,"

          + "FIELD3,"

                        + "FIELD4,"

          + "FIELD5,"

          + "FIELD6 FROM TABLE1 ORDER BY ID ASC";

          RDatabaseIndexAllItem databaseIndexAllItem =

                     retrievalApplicationContext

                            .getFacade()

          .createDatabaseIndexAllItem(false);

                

          databaseIndexAllItem.setIndexPathType("DB");

                 databaseIndexAllItem.setIndexInfoType("TABLE1");

                 // 如果無(wú)論記錄是否存在,都新增一條索引內(nèi)容,

          則使用RetrievalType.RIndexOperatorType.INSERT

                 // 如果索引中記錄已經(jīng)存在,則只更新索引中的對(duì)應(yīng)的記錄,

          否則新增記錄,則使用RetrievalType.RIndexOperatorType.UPDATE

                 databaseIndexAllItem

          .setIndexOperatorType(RetrievalType.

          RIndexOperatorType.INSERT);

                 databaseIndexAllItem.setTableName(tableName);

                 databaseIndexAllItem.setKeyField(keyField);

                 databaseIndexAllItem.setDefaultTitleFieldName("TITLE");

                 databaseIndexAllItem.setDefaultResumeFieldName("CONTENT");

                 databaseIndexAllItem.setPageSize(500);

                 databaseIndexAllItem.setSql(sql);

                 databaseIndexAllItem.setParam(new Object[] {});

                 databaseIndexAllItem

          .setDatabaseRecordInterceptor(new TestDatabaseRecordInterceptor());

                 IRDocOperatorFacade docOperatorFacade =

          retrievalApplicationContext

                        .getFacade()

          .createDocOperatorFacade();

                 long indexCount = docOperatorFacade.

          createAll(databaseIndexAllItem);

                 //優(yōu)化索引

                 retrievalApplicationContext

          .getFacade()

          .createIndexOperatorFacade("DB")

          .optimize();

          對(duì)大量的文件批量創(chuàng)建索引

                 RFileIndexAllItem fileIndexAllItem=

          retrievalApplicationContext

          .getFacade()

          .createFileIndexAllItem(false,"utf-8");

                 fileIndexAllItem.setIndexPathType("FILE");

                

                 //如果無(wú)論記錄是否存在,都新增一條索引內(nèi)容,

          則使用RetrievalType.RIndexOperatorType.INSERT,

                 //如果索引中記錄已經(jīng)存在,則只更新索引中的對(duì)應(yīng)的記錄,

          否則新增記錄,則使用RetrievalType.RIndexOperatorType.UPDATE

                 FileIndexAllItem

          .setIndexOperatorType(RetrievalType

          .RIndexOperatorType.INSERT);

                 fileIndexAllItem.setIndexInfoType("SFILE");

                

                 fileIndexAllItem

          .setFileBasePath("D:""workspace""resources""docs");

                 fileIndexAllItem.setIncludeSubDir(true);

                 fileIndexAllItem.setPageSize(100);

                 fileIndexAllItem

          .setIndexAllFileInterceptor(

          new TestFileIndexAllInterceptor());

                

                 //如果要對(duì)所有類(lèi)型的文件創(chuàng)建索引,則不要做設(shè)置一下這些設(shè)置,

          否則在設(shè)置過(guò)類(lèi)型之后,將只對(duì)這些類(lèi)型的文件創(chuàng)建索引

                 fileIndexAllItem.addFileType("doc");

                 fileIndexAllItem.addFileType("docx");

                 fileIndexAllItem.addFileType("sql");

                 fileIndexAllItem.addFileType("html");

                 fileIndexAllItem.addFileType("htm");

                 fileIndexAllItem.addFileType("txt");

                 fileIndexAllItem.addFileType("xls");

                

                 long count=docOperatorHelper.createAll(fileIndexAllItem);

                

                

          retrievalApplicationContext

          .getFacade()

          .createIndexOperatorFacade("FILE")

          .optimize();

          支持多線程創(chuàng)建索引,而不會(huì)出現(xiàn)索引文件異常

                 Thread thread1=new Thread(new Runnable(){

                 publicvoid run() {

                        do 單條或批量創(chuàng)建索引

                     }

                 });

                 Thread thread2=new Thread(new Runnable(){

                     publicvoid run() {

                        do 單條或批量創(chuàng)建索引

                     }

                 });

                 Thread thread3=new Thread(new Runnable(){

                 publicvoid run() {

                        do 單條或批量創(chuàng)建索引

                     }

                 });

                

                 thread1.start();

                 thread2.start();

          thread3.start();

          5、 查詢

          使用RQuery實(shí)例,通過(guò)傳入構(gòu)造好的QueryItem實(shí)例進(jìn)行查詢,并使用QuerySort實(shí)例對(duì)結(jié)果排序

                 public QueryItem createQueryItem(

          RetrievalType.RDocItemType docItemType,

          Object name,

          String value){

                     QueryItem queryItem=

          retrievalApplicationContext

          .getFacade()

          .createQueryItem(docItemType,

          String.valueOf(name),

          value);

                     return queryItem;

                  }

          IRQueryFacade queryFacade=

          retrievalApplicationContext

          .getFacade()

          .createQueryFacade();

                 RQuery query=queryFacade.createRQuery(indexPathType);

                 QueryItem queryItem0=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "TITLE","啊啊");

                 QueryItem queryItem1=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "TITLE","");

                 QueryItem queryItem2=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "CONTENT","工作");

                 QueryItem queryItem3=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "CONTENT","地方");

                 QueryItem queryItem4=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "FIELD3","過(guò)節(jié)");

                 QueryItem queryItem5=

          testQuery

          .createQueryItem(RetrievalType.RDocItemType.CONTENT,

          "FIELD4","高興");

                 QueryItem queryItem=

          queryItem0

          .should(QueryItem.SHOULD,queryItem1)

          .should(queryItem2)

          .should(queryItem3.mustNot(QueryItem.SHOULD,queryItem4)).should(queryItem5);

                 QuerySort querySort=new QuerySort(QueryUtil.createScoreSort());

                 QueryResult[] queryResults=

          query.getQueryResults(queryItem,querySort);

          query.close();

          6、 擴(kuò)展

          提供兩種途徑進(jìn)行擴(kuò)展:

          1) 在配置文件指定擴(kuò)展類(lèi),在加載時(shí),自動(dòng)讀取和設(shè)置配置文件中的擴(kuò)展類(lèi)

          2) RetrievalProperties實(shí)例中設(shè)置擴(kuò)展類(lèi),

          并使用該實(shí)例創(chuàng)建RetrievalApplicationContext實(shí)例

          IFileContentParserManager

          通過(guò)實(shí)現(xiàn)此接口,并替換整個(gè)文件內(nèi)容解析管理器,擴(kuò)展文件內(nèi)容解析方式

          或通過(guò)以下的方式,在原文件內(nèi)容解析管理器中替換或新增文件解析器

          實(shí)現(xiàn)IFileContentParser接口,并使用以下的方式新增或替換文件類(lèi)型的內(nèi)容解析器

                     retrievalApplicationContext

          .getRetrievalFactory()

          .getFileContentParserManager()

          .regFileContentParser(“docx”, fileContentParser)

          IRAnalyzerBuilder

          通過(guò)實(shí)現(xiàn)此接口,并替換分詞器構(gòu)建器

          IHighlighterMaker

          通過(guò)實(shí)現(xiàn)此接口,并替換內(nèi)容高亮處理器

          IRDatabaseIndexAll

          通過(guò)實(shí)現(xiàn)此接口,實(shí)現(xiàn)數(shù)據(jù)庫(kù)數(shù)據(jù)批量讀取并寫(xiě)入索引

          或直接繼承AbstractRDatabaseIndexAll抽象類(lèi),并實(shí)現(xiàn)其中的抽象方法

                     /**

                      * 獲取當(dāng)前頁(yè)數(shù)據(jù)庫(kù)記錄,每調(diào)用一次這個(gè)方法,就返回一頁(yè)的記錄

                      * @return

           */

          publicabstract List<Map> getResultList()

          7、 其它

          更詳細(xì)的示例請(qǐng)查閱test中的代碼

          snoics-retrieval項(xiàng)目中使用了snoics-base.jar,如果需要獲取snoics-base.jar的源代碼,請(qǐng)到http://code.google.com/p/snoics-base/中下載

          三、        關(guān)于

          項(xiàng)目地址:http://code.google.com/p/snoics-retrieval/

          Email : snoics@gmail.com

                 Blog : http://www.aygfsteel.com/snoics/

          posted on 2010-07-26 08:06 snoics 閱讀(2761) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 淮滨县| 乐东| 常德市| 大足县| 方正县| 金溪县| 尉犁县| 丹凤县| 景洪市| 米易县| 渑池县| 大冶市| 阳高县| 芒康县| 射洪县| 东丽区| 清新县| 新沂市| 子洲县| 成武县| 本溪| 石台县| 永寿县| 北宁市| 邵阳县| 武清区| 龙岩市| 荆门市| 聂荣县| 沙湾县| 锦州市| 定兴县| 凌源市| 江都市| 鸡西市| 山西省| 新竹县| 合江县| 崇阳县| 新绛县| 仁寿县|