資源簡介
基本能做到 10G的數據 0.0x秒返回
只要
1、將Searcher searcher = new IndexSearcher(reader);替換為InaccurateIndexSearcher searcher = new InaccurateIndexSearcher(reader, 5000);
2、將Hits hits = searcher.search(query);替換為InaccurateHits hits = searcher.search(query, sort, ascending);
就行了
代碼片段和文件信息
package?org.apache.lucene.search;
/**
?*?Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one?or?more
?*?contributor?license?agreements.??See?the?NOTICE?file?distributed?with
?*?this?work?for?additional?information?regarding?copyright?ownership.
?*?The?ASF?licenses?this?file?to?You?under?the?Apache?License?Version?2.0
?*?(the?“License“);?you?may?not?use?this?file?except?in?compliance?with
?*?the?License.??You?may?obtain?a?copy?of?the?License?at
?*
?*?????http://www.apache.org/licenses/LICENSE-2.0
?*
?*?Unless?required?by?applicable?law?or?agreed?to?in?writing?software
?*?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
?*?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
?*?See?the?License?for?the?specific?language?governing?p
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????16569??2007-05-15?11:14??org\apache\lucene\search\InaccurateBooleanScorer2.java
?????文件???????6238??2007-05-15?11:10??org\apache\lucene\search\InaccurateBooleanWeight2.java
?????文件???????3531??2007-05-15?11:09??org\apache\lucene\search\InaccurateHit.java
?????文件???????2339??2007-05-15?11:08??org\apache\lucene\search\InaccurateHitIterator.java
?????文件???????7067??2007-05-15?11:07??org\apache\lucene\search\InaccurateHits.java
?????文件???????4267??2007-05-15?10:56??org\apache\lucene\search\InaccurateIndexSearcher.java
?????文件???????3109??2007-05-15?11:03??org\apache\lucene\util\InaccurateResultAggregation.java
?????目錄??????????0??2007-05-15?10:50??org\apache\lucene\search
?????目錄??????????0??2007-05-15?10:50??org\apache\lucene\util
?????目錄??????????0??2007-05-15?10:50??org\apache\lucene
?????目錄??????????0??2007-05-15?10:50??org\apache
?????目錄??????????0??2007-05-15?10:50??org
?????文件???????1075??2007-05-15?12:08??readme.txt
-----------?---------??----------?-----??----
????????????????44195????????????????????13
評論
共有 條評論