LuceneX

基于Lucene的全文检索


LuceneService

<h1>默认索引接口实现</h1> <h2>实例化方式</h2> <pre><code class="language-java">private LuceneService commonService = new LuceneServiceImpl(&amp;quot;dataSource_1&amp;quot;);</code></pre> <p>重点:必须传入数据源Key</p> <h2>方法列表</h2> <pre><code class="language-java">/** * 添加索引集合 * @param obj 原声 javaBean * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void saveObj(List&amp;lt;T&amp;gt; object) throws IOException, IllegalAccessException; /** * 添加索引对象 * @param obj 原声 javaBean * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void saveObj(T object) throws IOException, IllegalAccessException; /** * 添加索引集合 * @param map 原声 javaBean * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void saveMap(List&amp;lt;T&amp;gt; map,Class&amp;lt;?&amp;gt; clas) throws IOException, IllegalAccessException; /** * 添加索引对象 * @param map 原声 javaBean * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void saveMap(T map,Class&amp;lt;?&amp;gt; clas) throws IOException, IllegalAccessException; /** * 添加索引集合 * @param documents * @throws IOException */ &amp;lt;T&amp;gt; void saveDocument(List&amp;lt;Document&amp;gt; document) throws IOException; /** * 添加索引对象 * @param document * @throws IOException */ &amp;lt;T&amp;gt; void saveDocument(Document document) throws IOException; /** * 清空索引 * @throws IOException */ void delAll() throws IOException; /** * 删除索引 * @param term * @throws IOException */ void delKey(Term term) throws IOException; /** * 删除索引 * @param query * @throws IOException */ void delKey(Query query) throws IOException; /** * 更新索引集合 * @param objs obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateObj(List&amp;lt;T&amp;gt; object, Term term) throws IOException, IllegalAccessException; /** * 更新索引对象 * @param obj obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateObj(T object, Term term) throws IOException, IllegalAccessException; /** * 更新索引集合 * @param objs obj 原声 javaBean * @param query * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateObj(List&amp;lt;T&amp;gt; object, Query query) throws Exception; /** * 更新索引对象 * @param obj obj 原声 javaBean * @param query * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateObj(T object, Query query) throws Exception; /** * 更新索引集合 * @param objs obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateMap(List&amp;lt;T&amp;gt; map, Term term,Class&amp;lt;?&amp;gt; clas) throws IOException, IllegalAccessException; /** * 更新索引对象 * @param obj obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateMap(T map, Term term,Class&amp;lt;?&amp;gt; clas) throws IOException, IllegalAccessException; /** * 更新索引集合 * @param objs obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateMap(List&amp;lt;T&amp;gt; map, Query query,Class&amp;lt;?&amp;gt; clas) throws Exception; /** * 更新索引对象 * @param obj obj 原声 javaBean * @param term * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; void updateMap(T map, Query query,Class&amp;lt;?&amp;gt; clas) throws Exception; /** * 更新索引集合 * @param docs * @param term * @throws IOException */ void updateDocument(List&amp;lt;Document&amp;gt; document, Term term) throws IOException; /** * 更新索引对象 * @param doc * @param term * @throws IOException */ void updateDocument(Document document, Term term) throws IOException; /** * 更新索引集合 * @param docs * @param term * @throws IOException */ void updateDocument(List&amp;lt;Document&amp;gt; document, Query query) throws Exception; /** * 更新索引对象 * @param doc * @param term * @throws IOException */ void updateDocument(Document document, Query query) throws Exception; /** * 查询索引集合 * @param query * @param obj 原声 javaBean class * @param num 条数 0 为所有 * @param sort 可以为 null * @return * @throws IOException * @throws InvalidTokenOffsetsException * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalAccessException * @throws InstantiationException * @throws InvocationTargetException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; List&amp;lt;T&amp;gt; findList(Query query, Class&amp;lt;T&amp;gt; clas, int num, Sort sort) throws IOException, InvalidTokenOffsetsException, InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException, InvocationTargetException; /** * 查询对象集合分页 * @param query * @param pageNumber 当前页 从 1开始 * @param pageSize 每页条数 0 为 10 * @param obj 原声 javaBean class * @param sort 可以为 null * @return * @throws IOException * @throws InvalidTokenOffsetsException * @throws SecurityException * @throws NoSuchFieldException * @throws IllegalAccessException * @throws InstantiationException * @throws InvocationTargetException * @throws IllegalArgumentException */ &amp;lt;T&amp;gt; Page&amp;lt;T&amp;gt; findList(Query query, int pageNumber, int pageSize, Class&amp;lt;T&amp;gt; clas, Sort sort) throws IOException, InvalidTokenOffsetsException, InstantiationException, IllegalAccessException, NoSuchFieldException, SecurityException, IllegalArgumentException, InvocationTargetException; </code></pre>

页面列表

ITEM_HTML