├── .gitignore ├── .travis.yml ├── Hibernate_Search_Example.png ├── README.md ├── hibernate-example ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── hibernate │ │ │ └── example │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── dao │ │ │ ├── BookDao.java │ │ │ └── impl │ │ │ │ └── BookDaoImpl.java │ │ │ ├── model │ │ │ ├── Author.java │ │ │ └── Book.java │ │ │ └── service │ │ │ ├── BookService.java │ │ │ └── impl │ │ │ └── BookServiceImpl.java │ ├── resources │ │ ├── applicationContext.xml │ │ ├── dispatcherServlet-servlet.xml │ │ ├── ehcache.xml │ │ ├── hibernate.cfg.xml │ │ ├── hibernate_search.sql │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── org │ │ │ └── hibernate │ │ │ │ └── example │ │ │ │ └── model │ │ │ │ ├── Author.hbm.xml │ │ │ │ └── Book.hbm.xml │ │ └── spy.properties │ └── webapp │ │ └── WEB-INF │ │ ├── views │ │ ├── error │ │ │ ├── 401.jsp │ │ │ ├── 404.jsp │ │ │ └── 500.jsp │ │ └── list.jsp │ │ └── web.xml │ └── test │ └── java │ └── org │ └── hibernate │ └── example │ └── dao │ └── impl │ └── BookDaoImplTest.java ├── hibernate-search-hibernate ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── hibernate │ │ │ └── search │ │ │ └── hibernate │ │ │ └── example │ │ │ ├── IndexManger.java │ │ │ ├── SearchManager.java │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── dao │ │ │ ├── BookDao.java │ │ │ └── impl │ │ │ │ └── BookDaoImpl.java │ │ │ ├── model │ │ │ ├── Author.java │ │ │ ├── Book.java │ │ │ └── QueryResult.java │ │ │ └── service │ │ │ ├── BookService.java │ │ │ └── impl │ │ │ └── BookServiceImpl.java │ ├── resources │ │ ├── IKAnalyzer.cfg.xml │ │ ├── applicationContext.xml │ │ ├── dic │ │ │ ├── administrative.dic │ │ │ ├── appellation.dic │ │ │ ├── company.dic │ │ │ ├── comupter-science.dic │ │ │ ├── contemporary-words.dic │ │ │ ├── division │ │ │ │ ├── africa.dic │ │ │ │ ├── america.dic │ │ │ │ ├── china.dic │ │ │ │ ├── europe.dic │ │ │ │ ├── japan.dic │ │ │ │ ├── korea.dic │ │ │ │ ├── oceania.dic │ │ │ │ ├── readme.txt │ │ │ │ └── taiwan.dic │ │ │ ├── festival.dic │ │ │ ├── language.dic │ │ │ ├── locale │ │ │ │ ├── beijing.dic │ │ │ │ ├── fuzhou.dic │ │ │ │ ├── quanzhou.dic │ │ │ │ ├── readme.txt │ │ │ │ └── xiamen.dic │ │ │ ├── name-foreign.dic │ │ │ ├── nation.dic │ │ │ ├── org-domestic.dic │ │ │ ├── org-foreign.dic │ │ │ ├── paoding-dic-names.properties │ │ │ ├── star-domestic.dic │ │ │ ├── star-foreign.dic │ │ │ ├── t-base.dic │ │ │ ├── x-confucian-family-name.dic │ │ │ ├── x-for-combinatorics.dic │ │ │ ├── x-noise-charactor.dic │ │ │ ├── x-noise-word.dic │ │ │ └── x-unit.dic │ │ ├── dispatcherServlet-servlet.xml │ │ ├── ehcache.xml │ │ ├── hibernate.cfg.xml │ │ ├── hibernate_search.sql │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── org │ │ │ └── hibernate │ │ │ │ └── search │ │ │ │ └── hibernate │ │ │ │ └── example │ │ │ │ └── model │ │ │ │ ├── Author.hbm.xml │ │ │ │ └── Book.hbm.xml │ │ ├── paoding-dic-home.properties │ │ ├── spy.properties │ │ └── stopword.dic │ └── webapp │ │ └── WEB-INF │ │ ├── resources │ │ └── js │ │ │ └── jquery-1.9.1.js │ │ ├── views │ │ ├── error │ │ │ ├── 401.jsp │ │ │ ├── 404.jsp │ │ │ └── 500.jsp │ │ └── list.jsp │ │ └── web.xml │ └── test │ └── java │ └── org │ └── hibernate │ └── search │ └── hibernate │ └── example │ └── dao │ └── impl │ └── BookDaoImplTest.java ├── hibernate-search-jpa ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── hibernate │ │ │ └── search │ │ │ └── jpa │ │ │ └── example │ │ │ ├── IndexManger.java │ │ │ ├── SearchManager.java │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── dao │ │ │ ├── BookDao.java │ │ │ └── impl │ │ │ │ └── BookDaoImpl.java │ │ │ ├── model │ │ │ ├── Author.java │ │ │ ├── Book.java │ │ │ └── QueryResult.java │ │ │ └── service │ │ │ ├── BookService.java │ │ │ └── impl │ │ │ └── BookServiceImpl.java │ ├── resources │ │ ├── IKAnalyzer.cfg.xml │ │ ├── META-INF │ │ │ └── persistence.xml │ │ ├── applicationContext.xml │ │ ├── dic │ │ │ ├── administrative.dic │ │ │ ├── appellation.dic │ │ │ ├── company.dic │ │ │ ├── comupter-science.dic │ │ │ ├── contemporary-words.dic │ │ │ ├── division │ │ │ │ ├── africa.dic │ │ │ │ ├── america.dic │ │ │ │ ├── china.dic │ │ │ │ ├── europe.dic │ │ │ │ ├── japan.dic │ │ │ │ ├── korea.dic │ │ │ │ ├── oceania.dic │ │ │ │ ├── readme.txt │ │ │ │ └── taiwan.dic │ │ │ ├── festival.dic │ │ │ ├── language.dic │ │ │ ├── locale │ │ │ │ ├── beijing.dic │ │ │ │ ├── fuzhou.dic │ │ │ │ ├── quanzhou.dic │ │ │ │ ├── readme.txt │ │ │ │ └── xiamen.dic │ │ │ ├── name-foreign.dic │ │ │ ├── nation.dic │ │ │ ├── org-domestic.dic │ │ │ ├── org-foreign.dic │ │ │ ├── paoding-dic-names.properties │ │ │ ├── star-domestic.dic │ │ │ ├── star-foreign.dic │ │ │ ├── t-base.dic │ │ │ ├── x-confucian-family-name.dic │ │ │ ├── x-for-combinatorics.dic │ │ │ ├── x-noise-charactor.dic │ │ │ ├── x-noise-word.dic │ │ │ └── x-unit.dic │ │ ├── dispatcherServlet-servlet.xml │ │ ├── ehcache.xml │ │ ├── hibernate_search.sql │ │ ├── jdbc.properties │ │ ├── logback.xml │ │ ├── org │ │ │ └── hibernate │ │ │ │ └── search │ │ │ │ └── jpa │ │ │ │ └── example │ │ │ │ └── model │ │ │ │ ├── Author.hbm.xml │ │ │ │ └── Book.hbm.xml │ │ ├── paoding-dic-home.properties │ │ ├── spy.properties │ │ └── stopword.dic │ └── webapp │ │ └── WEB-INF │ │ ├── resources │ │ └── js │ │ │ └── jquery-1.9.1.js │ │ ├── views │ │ ├── error │ │ │ ├── 401.jsp │ │ │ ├── 404.jsp │ │ │ └── 500.jsp │ │ └── list.jsp │ │ └── web.xml │ └── test │ └── java │ └── org │ └── hibernate │ └── search │ └── jpa │ └── example │ └── dao │ └── impl │ └── BookDaoImplTest.java ├── hibernate_search_reference.pdf └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | /.classpath 2 | /.project 3 | /.settings 4 | /target 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk7 4 | - oraclejdk7 5 | before_script: 6 | - mysql -e 'create database hibernate_search;' 7 | script: 8 | - mvn test 9 | - mvn test -Pfunctional-test -Dselenium.driver=firefox 10 | env: MAVEN_OPTS="-XX:MaxPermSize=128m" 11 | addons: 12 | firefox: "22.0" 13 | before_install: 14 | - "export DISPLAY=:99.0" 15 | - "sh -e /etc/init.d/xvfb start" -------------------------------------------------------------------------------- /Hibernate_Search_Example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/Hibernate_Search_Example.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hibernate-search-example 2 | 3 | [![Build Status](https://travis-ci.org/sxyx2008/hibernate-search-example.png)](https://travis-ci.org/sxyx2008/hibernate-search-example) 4 | 5 | # 项目描述 6 | 7 | Spring3.2+Hibernate4.2+Hibernate Search4.2整合IKAnalyzer、paoding实现中文分词索引实时同步。 8 | 9 | # 项目截图 10 | 11 | ![Hibernate_Search_Example.png](Hibernate_Search_Example.png) 12 | 13 | 1. hibernate-search-hibernate(基于hibernate4方式的实现) 14 | 15 | spring3.2+hibernate4.2+hibernate search4.2+IKAnalyzer+paoding 16 | 17 | 2. hibernate-search-jpa(基于jpa方式的实现) 18 | 19 | spring3.2+jpa+hibernate search4.2+IKAnalyzer+paoding 20 | 21 | 3. hibernate-example(spring3.2+hibernate4+spring mvc整合多对多例子) 22 | 23 | spring3.2+hibernate4.2+spring mvc 24 | 25 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sxyx2008/hibernate-search-example/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 26 | 27 | -------------------------------------------------------------------------------- /hibernate-example/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | hibernate-search-example 6 | org.hibernate.search.example 7 | 1.0 8 | 9 | 10 | hibernate-example 11 | war 12 | 13 | hibernate-example 14 | http://maven.apache.org 15 | 16 | 17 | 18 | org.slf4j 19 | slf4j-api 20 | 21 | 22 | 23 | ch.qos.logback 24 | logback-classic 25 | 26 | 27 | 28 | org.slf4j 29 | log4j-over-slf4j 30 | runtime 31 | 32 | 33 | 34 | org.slf4j 35 | jcl-over-slf4j 36 | runtime 37 | 38 | 39 | 40 | org.slf4j 41 | jul-to-slf4j 42 | runtime 43 | 44 | 45 | 46 | 47 | 48 | 49 | p6spy 50 | p6spy 51 | 52 | 53 | log4jdbc 54 | log4jdbc 55 | 56 | 57 | 58 | junit 59 | junit 60 | 61 | 62 | 63 | javax.servlet 64 | jstl 65 | 66 | 67 | 68 | javax.servlet 69 | servlet-api 70 | provided 71 | 72 | 73 | 74 | javax.servlet.jsp 75 | jsp-api 76 | provided 77 | 78 | 79 | 80 | 81 | org.springframework 82 | spring-webmvc 83 | 84 | 85 | 86 | org.springframework 87 | spring-orm 88 | 89 | 90 | 91 | org.springframework 92 | spring-aop 93 | 94 | 95 | 96 | org.springframework 97 | spring-tx 98 | 99 | 100 | 101 | org.springframework 102 | spring-jdbc 103 | 104 | 105 | 106 | org.springframework 107 | spring-webmvc 108 | 109 | 110 | 111 | org.springframework 112 | spring-web 113 | 114 | 115 | 116 | org.springframework 117 | spring-oxm 118 | 119 | 120 | commons-lang 121 | commons-lang 122 | 123 | 124 | 125 | 126 | 127 | org.springframework 128 | spring-test 129 | 130 | 131 | 132 | org.springframework 133 | spring-aspects 134 | 135 | 136 | 137 | 138 | 139 | org.springframework.data 140 | spring-data-jpa 141 | 142 | 143 | spring-aop 144 | org.springframework 145 | 146 | 147 | 148 | 149 | 150 | 151 | org.hibernate 152 | hibernate-core 153 | 154 | 155 | 156 | org.hibernate 157 | hibernate-ehcache 158 | 159 | 160 | 161 | org.hibernate.javax.persistence 162 | hibernate-jpa-2.0-api 163 | 164 | 165 | 166 | org.hibernate 167 | hibernate-entitymanager 168 | 169 | 170 | 171 | 172 | org.hibernate 173 | hibernate-search 174 | 175 | 176 | 177 | org.hibernate 178 | hibernate-search-analyzers 179 | 180 | 181 | 182 | org.hibernate 183 | hibernate-search-infinispan 184 | 185 | 186 | 187 | net.sf.ehcache 188 | ehcache-core 189 | 190 | 191 | 192 | 193 | IKAnalyzer 194 | IKAnalyzer 195 | 196 | 197 | 198 | net.paoding.analysis.analyzer 199 | paoding-analyzer 200 | 201 | 202 | 203 | 204 | org.hibernate 205 | hibernate-validator 206 | 207 | 208 | 209 | 210 | com.alibaba 211 | druid 212 | 213 | 214 | 215 | 216 | 217 | org.aspectj 218 | aspectjweaver 219 | 220 | 221 | 222 | 223 | org.codehaus.jackson 224 | jackson-mapper-asl 225 | 226 | 227 | 228 | org.codehaus.jackson 229 | jackson-core-asl 230 | 231 | 232 | 233 | mysql 234 | mysql-connector-java 235 | 236 | 237 | 238 | 239 | hibernate-example 240 | 241 | 242 | org.apache.maven.plugins 243 | maven-compiler-plugin 244 | 245 | 1.5 246 | 1.5 247 | 248 | 249 | 250 | 251 | org.apache.maven.plugins 252 | maven-release-plugin 253 | 254 | 255 | 256 | org.apache.maven.plugins 257 | maven-compiler-plugin 258 | 259 | 1.6 260 | 1.6 261 | 262 | 263 | 264 | 268 | 269 | 270 | org.apache.tomcat.maven 271 | tomcat6-maven-plugin 272 | 273 | 274 | 275 | org.apache.tomcat.maven 276 | tomcat7-maven-plugin 277 | 278 | 279 | 283 | 284 | org.mortbay.jetty 285 | maven-jetty-plugin 286 | 287 | 288 | 293 | 294 | 295 | org.codehaus.mojo 296 | jboss-maven-plugin 297 | 298 | localhost 299 | 8080 300 | D:/jboss-4.2.3.GA 301 | target/maven-framework.war 302 | all 303 | 304 | 305 | 306 | 307 | 311 | 312 | org.jboss.as.plugins 313 | jboss-as-maven-plugin 314 | 315 | 316 | 317 | 318 | org.apache.maven.plugins 319 | maven-eclipse-plugin 320 | 321 | true 322 | false 323 | 2.0 324 | 325 | 326 | 327 | .settings/org.eclipse.core.resources.prefs 328 | 329 | =${project.build.sourceEncoding}${line.separator}]]> 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/controller/BookController.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-example/src/main/java/org/hibernate/example/controller/BookController.java -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.example.model.Book; 6 | 7 | public interface BookDao { 8 | 9 | void add(Book book); 10 | 11 | Book load(int id); 12 | 13 | List query(int start,int pagesize); 14 | void update(Book book); 15 | void delete(Book book); 16 | void delete(int id); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.dao.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.hibernate.example.dao.BookDao; 8 | import org.hibernate.example.model.Book; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Qualifier; 11 | import org.springframework.stereotype.Repository; 12 | 13 | @Repository(value="bookDaoImpl") 14 | public class BookDaoImpl implements BookDao { 15 | 16 | @Autowired 17 | @Qualifier("hibernate4sessionFactory") 18 | private SessionFactory sessionFactory; 19 | 20 | public Session getSession() { 21 | return sessionFactory.getCurrentSession(); 22 | } 23 | 24 | 25 | @Override 26 | public void add(Book book) { 27 | this.getSession().persist(book); 28 | } 29 | 30 | @SuppressWarnings("unchecked") 31 | @Override 32 | public List query(int start, int pagesize) { 33 | return getSession().createCriteria(Book.class).setFirstResult(start).setMaxResults(pagesize).list(); 34 | } 35 | 36 | @Override 37 | public void update(Book book) { 38 | getSession().merge(book); 39 | } 40 | 41 | @Override 42 | public void delete(Book book) { 43 | getSession().delete(book); 44 | } 45 | 46 | @Override 47 | public void delete(int id) { 48 | 49 | getSession().delete(load(id)); 50 | 51 | } 52 | 53 | @Override 54 | public Book load(int id) { 55 | return (Book) getSession().get(Book.class, id); 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/model/Author.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.model; 2 | 3 | import java.util.Set; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Entity; 7 | import javax.persistence.FetchType; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.ManyToMany; 12 | import javax.persistence.Table; 13 | 14 | import org.hibernate.annotations.Cache; 15 | import org.hibernate.annotations.CacheConcurrencyStrategy; 16 | 17 | @Entity 18 | @Table(catalog="hibernate_search",name="Author") 19 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 20 | public class Author { 21 | @Id 22 | @GeneratedValue(strategy=GenerationType.AUTO) 23 | private Integer id; 24 | 25 | private String name; 26 | 27 | @ManyToMany(fetch=FetchType.EAGER,mappedBy="authors",cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE}) 28 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 29 | private Set books; 30 | 31 | public Integer getId() { 32 | return id; 33 | } 34 | 35 | public void setId(Integer id) { 36 | this.id = id; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | public Set getBooks() { 48 | return books; 49 | } 50 | 51 | public void setBooks(Set books) { 52 | this.books = books; 53 | } 54 | 55 | public Author() { 56 | } 57 | 58 | public Author(String name) { 59 | super(); 60 | this.name = name; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/model/Book.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.model; 2 | 3 | import java.util.Date; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | import javax.persistence.CascadeType; 8 | import javax.persistence.Entity; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.JoinColumn; 14 | import javax.persistence.JoinTable; 15 | import javax.persistence.ManyToMany; 16 | import javax.persistence.Table; 17 | 18 | import org.hibernate.annotations.Cache; 19 | import org.hibernate.annotations.CacheConcurrencyStrategy; 20 | 21 | @Entity 22 | @Table(catalog="hibernate_search",name="Book") 23 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 24 | public class Book { 25 | @Id 26 | @GeneratedValue(strategy=GenerationType.AUTO) 27 | private Integer id; 28 | 29 | private String name; 30 | 31 | private String description; 32 | 33 | private Date publicationDate; 34 | 35 | @ManyToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE},fetch=FetchType.EAGER) 36 | @JoinTable( 37 | catalog="hibernate_search", 38 | name="Book_Author", 39 | joinColumns={@JoinColumn(name = "book_id")}, 40 | inverseJoinColumns = {@JoinColumn(name = "author_id")} 41 | ) 42 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 43 | private Set authors = new HashSet(); 44 | 45 | public Integer getId() { 46 | return id; 47 | } 48 | 49 | public void setId(Integer id) { 50 | this.id = id; 51 | } 52 | 53 | public String getName() { 54 | return name; 55 | } 56 | 57 | public void setName(String name) { 58 | this.name = name; 59 | } 60 | 61 | public String getDescription() { 62 | return description; 63 | } 64 | 65 | public void setDescription(String description) { 66 | this.description = description; 67 | } 68 | 69 | public Date getPublicationDate() { 70 | return publicationDate; 71 | } 72 | 73 | public void setPublicationDate(Date publicationDate) { 74 | this.publicationDate = publicationDate; 75 | } 76 | 77 | public Set getAuthors() { 78 | return authors; 79 | } 80 | 81 | public void setAuthors(Set authors) { 82 | this.authors = authors; 83 | } 84 | 85 | public Book() { 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/service/BookService.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.service; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.example.model.Book; 6 | 7 | public interface BookService { 8 | 9 | void add(Book book); 10 | 11 | Book load(int id); 12 | 13 | List query(int start,int pagesize); 14 | void update(Book book); 15 | void delete(Book book); 16 | void delete(int id); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /hibernate-example/src/main/java/org/hibernate/example/service/impl/BookServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.example.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.hibernate.example.dao.BookDao; 8 | import org.hibernate.example.model.Book; 9 | import org.hibernate.example.service.BookService; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Propagation; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | @Service(value="bookServiceImpl") 15 | @Transactional(propagation=Propagation.REQUIRED) 16 | public class BookServiceImpl implements BookService { 17 | 18 | @Resource(name="bookDaoImpl") 19 | private BookDao bookDao; 20 | 21 | @Override 22 | public void add(Book book) { 23 | bookDao.add(book); 24 | } 25 | 26 | @Override 27 | public List query(int start, int pagesize) { 28 | return bookDao.query(start, pagesize); 29 | } 30 | 31 | @Override 32 | public void update(Book book) { 33 | bookDao.update(book); 34 | } 35 | 36 | @Override 37 | public void delete(Book book) { 38 | bookDao.delete(book); 39 | } 40 | 41 | @Override 42 | public void delete(int id) { 43 | bookDao.delete(id); 44 | } 45 | 46 | @Override 47 | public Book load(int id) { 48 | return bookDao.load(id); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | org.hibernate.dialect.MySQL5InnoDBDialect 77 | 78 | 79 | 20 80 | 81 | 82 | 83 | 84 | true 85 | true 86 | org.hibernate.cache.EhCacheProvider 87 | org.hibernate.cache.ehcache.EhCacheRegionFactory 88 | /ehcache.xml 89 | 90 | 91 | 92 | 93 | 94 | 95 | org.hibernate.example.model 96 | 97 | 98 | 99 | 107 | 108 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 156 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/dispatcherServlet-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 17 | 18 | 23 | 24 | 25 | 26 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | com.mysql.jdbc.Driver 9 | jdbc:mysql://127.0.0.1:3306/hibernate_search 10 | travis 11 | org.hibernate.dialect.MySQL5InnoDBDialect 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/hibernate_search.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-example/src/main/resources/hibernate_search.sql -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | #log4jdbc# 2 | #url=jdbc:log4jdbc:mysql://localhost:3306/framework 3 | #driverClassName=net.sf.log4jdbc.DriverSpy 4 | 5 | #P6Spy# 6 | #url=jdbc:mysql://localhost:3306/framework 7 | #driverClassName=com.p6spy.engine.spy.P6SpyDriver 8 | 9 | log4jdbc.driverClassName=net.sf.log4jdbc.DriverSpy 10 | P6Spy.driverClassName=com.p6spy.engine.spy.P6SpyDriver 11 | 12 | username=travis 13 | password 14 | 15 | 16 | log4jdbc.url=jdbc:log4jdbc:mysql://127.0.0.1:3306/hibernate_search 17 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | logs/hibernate-example.log 13 | 14 | logs/hibernate-example.%d{yyyy-MM-dd}.log 15 | 16 | 17 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/org/hibernate/example/model/Author.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/org/hibernate/example/model/Book.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /hibernate-example/src/main/resources/spy.properties: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | # P6Spy Options File # 3 | # See documentation for detailed instructions # 4 | ################################################################# 5 | 6 | ################################################################# 7 | # MODULES # 8 | # # 9 | # Modules provide the P6Spy functionality. If a module, such # 10 | # as module_log is commented out, that functionality will not # 11 | # be available. If it is not commented out (if it is active), # 12 | # the functionality will be active. # 13 | # # 14 | # Values set in Modules cannot be reloaded using the # 15 | # reloadproperties variable. Once they are loaded, they remain # 16 | # in memory until the application is restarted. # 17 | # # 18 | ################################################################# 19 | 20 | module.log=com.p6spy.engine.logging.P6LogFactory 21 | #module.outage=com.p6spy.engine.outage.P6OutageFactory 22 | 23 | ################################################################# 24 | # REALDRIVER(s) # 25 | # # 26 | # In your application server configuration file you replace the # 27 | # "real driver" name with com.p6spy.engine.P6SpyDriver. This is # 28 | # where you put the name of your real driver P6Spy can find and # 29 | # register your real driver to do the database work. # 30 | # # 31 | # If your application uses several drivers specify them in # 32 | # realdriver2, realdriver3. See the documentation for more # 33 | # details. # 34 | # # 35 | # Values set in REALDRIVER(s) cannot be reloaded using the # 36 | # reloadproperties variable. Once they are loaded, they remain # 37 | # in memory until the application is restarted. # 38 | # # 39 | ################################################################# 40 | 41 | # oracle driver 42 | # realdriver=oracle.jdbc.driver.OracleDriver 43 | 44 | # mysql Connector/J driver 45 | # realdriver=com.mysql.jdbc.Driver 46 | 47 | # informix driver 48 | # realdriver=com.informix.jdbc.IfxDriver 49 | 50 | # ibm db2 driver 51 | # realdriver=COM.ibm.db2.jdbc.net.DB2Driver 52 | 53 | # the mysql open source driver 54 | realdriver=com.mysql.jdbc.Driver 55 | 56 | #specifies another driver to use 57 | realdriver2= 58 | #specifies a third driver to use 59 | realdriver3= 60 | 61 | 62 | #the DriverManager class sequentially tries every driver that is 63 | #registered to find the right driver. In some instances, it's possible to 64 | #load up the realdriver before the p6spy driver, in which case your connections 65 | #will not get wrapped as the realdriver will "steal" the connection before 66 | #p6spy sees it. Set the following property to "true" to cause p6spy to 67 | #explicitily deregister the realdrivers 68 | deregisterdrivers=true 69 | 70 | ################################################################ 71 | # P6LOG SPECIFIC PROPERTIES # 72 | ################################################################ 73 | # no properties currently available 74 | 75 | ################################################################ 76 | # EXECUTION THRESHOLD PROPERTIES # 77 | ################################################################ 78 | # This feature applies to the standard logging of P6Spy. # 79 | # While the standard logging logs out every statement # 80 | # regardless of its execution time, this feature puts a time # 81 | # condition on that logging. Only statements that have taken # 82 | # longer than the time specified (in milliseconds) will be # 83 | # logged. This way it is possible to see only statements that # 84 | # have exceeded some high water mark. # 85 | # This time is reloadable. # 86 | # 87 | # executionthreshold=integer time (milliseconds) 88 | # 89 | executionthreshold= 90 | 91 | ################################################################ 92 | # P6OUTAGE SPECIFIC PROPERTIES # 93 | ################################################################ 94 | # Outage Detection 95 | # 96 | # This feature detects long-running statements that may be indicative of 97 | # a database outage problem. If this feature is turned on, it will log any 98 | # statement that surpasses the configurable time boundary during its execution. 99 | # When this feature is enabled, no other statements are logged except the long 100 | # running statements. The interval property is the boundary time set in seconds. 101 | # For example, if this is set to 2, then any statement requiring at least 2 102 | # seconds will be logged. Note that the same statement will continue to be logged 103 | # for as long as it executes. So if the interval is set to 2, and the query takes 104 | # 11 seconds, it will be logged 5 times (at the 2, 4, 6, 8, 10 second intervals). 105 | # 106 | # outagedetection=true|false 107 | # outagedetectioninterval=integer time (seconds) 108 | # 109 | outagedetection=false 110 | outagedetectioninterval= 111 | 112 | ################################################################ 113 | # COMMON PROPERTIES # 114 | ################################################################ 115 | 116 | # filter what is logged 117 | filter=false 118 | 119 | # comma separated list of tables to include when filtering 120 | include = 121 | # comma separated list of tables to exclude when filtering 122 | exclude = 123 | 124 | # sql expression to evaluate if using regex filtering 125 | sqlexpression = 126 | 127 | 128 | # turn on tracing 129 | autoflush = true 130 | 131 | # sets the date format using Java's SimpleDateFormat routine 132 | dateformat= 133 | 134 | #list of categories to explicitly include 135 | includecategories= 136 | 137 | #list of categories to exclude: error, info, batch, debug, statement, 138 | #commit, rollback and result are valid values 139 | excludecategories=info,debug,result,batch 140 | 141 | 142 | #allows you to use a regex engine or your own matching engine to determine 143 | #which statements to log 144 | # 145 | #stringmatcher=com.p6spy.engine.common.GnuRegexMatcher 146 | #stringmatcher=com.p6spy.engine.common.JakartaRegexMatcher 147 | stringmatcher= 148 | 149 | # prints a stack trace for every statement logged 150 | stacktrace=false 151 | # if stacktrace=true, specifies the stack trace to print 152 | stacktraceclass= 153 | 154 | # determines if property file should be reloaded 155 | reloadproperties=false 156 | # determines how often should be reloaded in seconds 157 | reloadpropertiesinterval=60 158 | 159 | #if=true then url must be prefixed with p6spy: 160 | useprefix=false 161 | 162 | #specifies the appender to use for logging 163 | #appender=com.p6spy.engine.logging.appender.Log4jLogger 164 | #appender=com.p6spy.engine.logging.appender.StdoutLogger 165 | appender=com.p6spy.engine.logging.appender.FileLogger 166 | 167 | # name of logfile to use, note Windows users should make sure to use forward slashes in their pathname (e:/test/spy.log) (used for file logger only) 168 | logfile = spy.log 169 | 170 | # append to the p6spy log file. if this is set to false the 171 | # log file is truncated every time. (file logger only) 172 | append=true 173 | 174 | #The following are for log4j logging only 175 | log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender 176 | log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout 177 | log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n 178 | 179 | #log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender 180 | #log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost 181 | #log4j.appender.CHAINSAW_CLIENT.Port=4445 182 | #log4j.appender.CHAINSAW_CLIENT.LocationInfo=true 183 | 184 | log4j.logger.p6spy=INFO,STDOUT 185 | 186 | 187 | ################################################################# 188 | # DataSource replacement # 189 | # # 190 | # Replace the real DataSource class in your application server # 191 | # configuration with the name com.p6spy.engine.spy.P6DataSource,# 192 | # then add the JNDI name and class name of the real # 193 | # DataSource here # 194 | # # 195 | # Values set in this item cannot be reloaded using the # 196 | # reloadproperties variable. Once it is loaded, it remains # 197 | # in memory until the application is restarted. # 198 | # # 199 | ################################################################# 200 | #realdatasource=/RealMySqlDS 201 | #realdatasourceclass=com.mysql.jdbc.jdbc2.optional.MysqlDataSource 202 | 203 | ################################################################# 204 | # DataSource properties # 205 | # # 206 | # If you are using the DataSource support to intercept calls # 207 | # to a DataSource that requires properties for proper setup, # 208 | # define those properties here. Use name value pairs, separate # 209 | # the name and value with a semicolon, and separate the # 210 | # pairs with commas. # 211 | # # 212 | # The example shown here is for mysql # 213 | # # 214 | ################################################################# 215 | #realdatasourceproperties=port;3306,serverName;ibmhost,databaseName;mydb 216 | 217 | 218 | ################################################################# 219 | # JNDI DataSource lookup # 220 | # # 221 | # If you are using the DataSource support outside of an app # 222 | # server, you will probably need to define the JNDI Context # 223 | # environment. # 224 | # # 225 | # If the P6Spy code will be executing inside an app server then # 226 | # do not use these properties, and the DataSource lookup will # 227 | # use the naming context defined by the app server. # 228 | # # 229 | # The two standard elements of the naming environment are # 230 | # jndicontextfactory and jndicontextproviderurl. If you need # 231 | # additional elements, use the jndicontextcustom property. # 232 | # You can define multiple properties in jndicontextcustom, # 233 | # in name value pairs. Separate the name and value with a # 234 | # semicolon, and separate the pairs with commas. # 235 | # # 236 | # The example shown here is for a standalone program running on # 237 | # a machine that is also running JBoss, so the JDNI context # 238 | # is configured for JBoss (3.0.4). # 239 | # # 240 | ################################################################# 241 | #jndicontextfactory=org.jnp.interfaces.NamingContextFactory 242 | #jndicontextproviderurl=localhost:1099 243 | #jndicontextcustom=java.naming.factory.url.pkgs;org.jboss.nameing:org.jnp.interfaces 244 | 245 | #jndicontextfactory=com.ibm.websphere.naming.WsnInitialContextFactory 246 | #jndicontextproviderurl=iiop://localhost:900 -------------------------------------------------------------------------------- /hibernate-example/src/main/webapp/WEB-INF/views/error/401.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> 3 | 4 | 5 | 6 | Access Denied 7 | 15 | 16 | 17 |
18 |

Access Denied

19 |
20 |

访问被拒绝

21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /hibernate-example/src/main/webapp/WEB-INF/views/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | <%response.setStatus(200);%> 5 | 6 | 7 | 8 | 9 | 404 - 页面不存在 10 | 15 | 16 | 17 | 18 |
19 |

404公益页面

20 | 21 |

">返回首页

22 |
23 | 24 | -------------------------------------------------------------------------------- /hibernate-example/src/main/webapp/WEB-INF/views/error/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ page import="org.slf4j.Logger,org.slf4j.LoggerFactory" %> 4 | <%response.setStatus(200);%> 5 | 6 | <% 7 | Throwable ex = null; 8 | if (exception != null) 9 | ex = exception; 10 | if (request.getAttribute("javax.servlet.error.exception") != null) 11 | ex = (Throwable) request.getAttribute("javax.servlet.error.exception"); 12 | 13 | //记录日志 14 | Logger logger = LoggerFactory.getLogger("500.jsp"); 15 | logger.error(ex.getMessage(), ex); 16 | %> 17 | 18 | 19 | 20 | 21 | 500 - 系统内部错误 22 | 23 | 24 | 25 |

500 - 系统发生内部错误.

26 |

">返回首页

27 | 28 | -------------------------------------------------------------------------------- /hibernate-example/src/main/webapp/WEB-INF/views/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | 7 | Hibernate Search Example 8 | 9 | 10 | 11 | 共查到[${lists.size()}]处结果!
12 | 13 | 14 | 编号 :
15 | 书名 :
16 | 作者 : 17 | 18 |   19 |
20 | 描述 :
21 | 出版日期 :
22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /hibernate-example/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | hibernate-example 4 | 5 | 6 | org.springframework.web.context.ContextLoaderListener 7 | 8 | 9 | 10 | org.springframework.web.util.IntrospectorCleanupListener 11 | 12 | 13 | 14 | contextConfigLocation 15 | classpath:applicationContext.xml 16 | 17 | 18 | 19 | 20 | encodingFilter 21 | org.springframework.web.filter.CharacterEncodingFilter 22 | 23 | encoding 24 | UTF-8 25 | 26 | 27 | forceEncoding 28 | true 29 | 30 | 31 | 32 | encodingFilter 33 | /* 34 | 35 | 36 | 37 | DruidWebStatFilter 38 | com.alibaba.druid.support.http.WebStatFilter 39 | 40 | exclusions 41 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 42 | 43 | 44 | sessionStatMaxCount 45 | 1000 46 | 47 | 48 | sessionStatEnable 49 | true 50 | 51 | 52 | profileEnable 53 | true 54 | 55 | 56 | 57 | DruidWebStatFilter 58 | /* 59 | 60 | 61 | 62 | 63 | 64 | DruidStatView 65 | com.alibaba.druid.support.http.StatViewServlet 66 | 67 | 68 | DruidStatView 69 | /druid/* 70 | 71 | 72 | 73 | 74 | 75 | 76 | openSessionInViewFilter 77 | org.springframework.orm.hibernate4.support.OpenSessionInViewFilter 78 | 79 | sessionFactoryBeanName 80 | hibernate4sessionFactory 81 | 82 | 83 | singleSession 84 | true 85 | 86 | 87 | flushMode 88 | AUTO 89 | 90 | 91 | 92 | openSessionInViewFilter 93 | /* 94 | 95 | 96 | 97 | 98 | dispatcherServlet 99 | org.springframework.web.servlet.DispatcherServlet 100 | 101 | contextConfigLocation 102 | classpath:dispatcherServlet-servlet.xml 103 | 104 | 1 105 | 106 | 107 | 108 | dispatcherServlet 109 | / 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 401 118 | /WEB-INF/views/error/401.jsp 119 | 120 | 121 | 122 | 404 123 | /WEB-INF/views/error/404.jsp 124 | 125 | 126 | 127 | 500 128 | /WEB-INF/views/error/500.jsp 129 | 130 | 131 | 132 | 30 133 | 134 | 135 | 136 | index.jsp 137 | 138 | -------------------------------------------------------------------------------- /hibernate-example/src/test/java/org/hibernate/example/dao/impl/BookDaoImplTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-example/src/test/java/org/hibernate/example/dao/impl/BookDaoImplTest.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | hibernate-search-example 7 | org.hibernate.search.example 8 | 1.0 9 | ../pom.xml 10 | 11 | hibernate-search-hibernate 12 | war 13 | hibernate-search-hibernate 14 | http://maven.apache.org 15 | 16 | 17 | 18 | org.slf4j 19 | slf4j-api 20 | 21 | 22 | 23 | ch.qos.logback 24 | logback-classic 25 | 26 | 27 | 28 | org.slf4j 29 | log4j-over-slf4j 30 | runtime 31 | 32 | 33 | 34 | org.slf4j 35 | jcl-over-slf4j 36 | runtime 37 | 38 | 39 | 40 | org.slf4j 41 | jul-to-slf4j 42 | runtime 43 | 44 | 45 | 46 | 47 | 48 | 49 | p6spy 50 | p6spy 51 | 52 | 53 | log4jdbc 54 | log4jdbc 55 | 56 | 57 | 58 | junit 59 | junit 60 | 61 | 62 | 63 | javax.servlet 64 | jstl 65 | 66 | 67 | 68 | javax.servlet 69 | servlet-api 70 | provided 71 | 72 | 73 | 74 | javax.servlet.jsp 75 | jsp-api 76 | provided 77 | 78 | 79 | 80 | 81 | org.springframework 82 | spring-webmvc 83 | 84 | 85 | 86 | org.springframework 87 | spring-orm 88 | 89 | 90 | 91 | org.springframework 92 | spring-aop 93 | 94 | 95 | 96 | org.springframework 97 | spring-tx 98 | 99 | 100 | 101 | org.springframework 102 | spring-jdbc 103 | 104 | 105 | 106 | org.springframework 107 | spring-webmvc 108 | 109 | 110 | 111 | org.springframework 112 | spring-web 113 | 114 | 115 | 116 | org.springframework 117 | spring-oxm 118 | 119 | 120 | commons-lang 121 | commons-lang 122 | 123 | 124 | 125 | 126 | 127 | org.springframework 128 | spring-test 129 | 130 | 131 | 132 | org.springframework 133 | spring-aspects 134 | 135 | 136 | 137 | 138 | 139 | org.springframework.data 140 | spring-data-jpa 141 | 142 | 143 | spring-aop 144 | org.springframework 145 | 146 | 147 | 148 | 149 | 150 | 151 | org.hibernate 152 | hibernate-core 153 | 154 | 155 | 156 | org.hibernate 157 | hibernate-ehcache 158 | 159 | 160 | 161 | org.hibernate.javax.persistence 162 | hibernate-jpa-2.0-api 163 | 164 | 165 | 166 | org.hibernate 167 | hibernate-entitymanager 168 | 169 | 170 | 171 | 172 | org.hibernate 173 | hibernate-search 174 | 175 | 176 | 177 | org.hibernate 178 | hibernate-search-analyzers 179 | 180 | 181 | 182 | org.hibernate 183 | hibernate-search-infinispan 184 | 185 | 186 | 187 | net.sf.ehcache 188 | ehcache-core 189 | 190 | 191 | 192 | 193 | IKAnalyzer 194 | IKAnalyzer 195 | 196 | 197 | 198 | net.paoding.analysis.analyzer 199 | paoding-analyzer 200 | 201 | 202 | 203 | 204 | org.hibernate 205 | hibernate-validator 206 | 207 | 208 | 209 | 210 | com.alibaba 211 | druid 212 | 213 | 214 | 215 | 216 | 217 | org.aspectj 218 | aspectjweaver 219 | 220 | 221 | 222 | 223 | org.codehaus.jackson 224 | jackson-mapper-asl 225 | 226 | 227 | 228 | org.codehaus.jackson 229 | jackson-core-asl 230 | 231 | 232 | 233 | mysql 234 | mysql-connector-java 235 | 236 | 237 | 238 | 239 | hibernate-search-hibernate 240 | 241 | 242 | org.apache.maven.plugins 243 | maven-compiler-plugin 244 | 245 | 1.5 246 | 1.5 247 | 248 | 249 | 250 | 251 | org.apache.maven.plugins 252 | maven-release-plugin 253 | 254 | 255 | 256 | org.apache.maven.plugins 257 | maven-compiler-plugin 258 | 259 | 1.6 260 | 1.6 261 | 262 | 263 | 264 | 268 | 269 | 270 | org.apache.tomcat.maven 271 | tomcat6-maven-plugin 272 | 273 | 274 | 275 | org.apache.tomcat.maven 276 | tomcat7-maven-plugin 277 | 278 | 279 | 283 | 284 | org.mortbay.jetty 285 | maven-jetty-plugin 286 | 287 | 288 | 293 | 294 | 295 | org.codehaus.mojo 296 | jboss-maven-plugin 297 | 298 | localhost 299 | 8080 300 | D:/jboss-4.2.3.GA 301 | target/maven-framework.war 302 | all 303 | 304 | 305 | 306 | 307 | 311 | 312 | org.jboss.as.plugins 313 | jboss-as-maven-plugin 314 | 315 | 316 | 317 | 318 | org.apache.maven.plugins 319 | maven-eclipse-plugin 320 | 321 | true 322 | false 323 | 2.0 324 | 325 | 326 | 327 | .settings/org.eclipse.core.resources.prefs 328 | 329 | =${project.build.sourceEncoding}${line.separator}]]> 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/IndexManger.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/IndexManger.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/SearchManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/SearchManager.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/controller/BookController.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/controller/BookController.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.hibernate.example.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.lucene.analysis.Analyzer; 6 | import org.hibernate.search.hibernate.example.model.Book; 7 | import org.hibernate.search.hibernate.example.model.QueryResult; 8 | 9 | public interface BookDao { 10 | 11 | void add(Book book); 12 | 13 | Book load(int id); 14 | 15 | List query(int start,int pagesize); 16 | void update(Book book); 17 | void delete(Book book); 18 | void delete(int id); 19 | 20 | /** 21 | * 22 | * @param keyword 23 | * @param start 24 | * @param pagesize 25 | * @param analyzer 26 | * @param field 27 | * @return 28 | * @throws Exception 29 | */ 30 | QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer,String...field) throws Exception; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/dao/impl/BookDaoImpl.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/model/Author.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.hibernate.example.model; 2 | 3 | import java.util.Set; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.FetchType; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.ManyToMany; 11 | import javax.persistence.Table; 12 | 13 | import org.codehaus.jackson.annotate.JsonIgnore; 14 | import org.hibernate.annotations.Cache; 15 | import org.hibernate.annotations.CacheConcurrencyStrategy; 16 | import org.hibernate.search.annotations.Analyze; 17 | import org.hibernate.search.annotations.ContainedIn; 18 | import org.hibernate.search.annotations.Field; 19 | import org.hibernate.search.annotations.Index; 20 | import org.hibernate.search.annotations.Store; 21 | 22 | @Entity 23 | @Table(catalog="hibernate_search",name="Author") 24 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 25 | public class Author { 26 | @Id 27 | @GeneratedValue(strategy=GenerationType.AUTO) 28 | private Integer id; 29 | 30 | @Field(index=Index.YES,analyze=Analyze.NO,store=Store.COMPRESS) 31 | private String name; 32 | 33 | @ManyToMany(fetch=FetchType.LAZY,mappedBy="authors"/*,cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE}*/) 34 | @ContainedIn 35 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 36 | @JsonIgnore 37 | private Set books; 38 | 39 | public Integer getId() { 40 | return id; 41 | } 42 | 43 | public void setId(Integer id) { 44 | this.id = id; 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | public Set getBooks() { 56 | return books; 57 | } 58 | 59 | public void setBooks(Set books) { 60 | this.books = books; 61 | } 62 | 63 | public Author() { 64 | } 65 | 66 | public Author(String name) { 67 | super(); 68 | this.name = name; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/model/Book.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.hibernate.example.model; 2 | 3 | import static org.hibernate.search.annotations.FieldCacheType.CLASS; 4 | import static org.hibernate.search.annotations.FieldCacheType.ID; 5 | 6 | import java.util.Date; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | import javax.persistence.CascadeType; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.GeneratedValue; 14 | import javax.persistence.GenerationType; 15 | import javax.persistence.Id; 16 | import javax.persistence.JoinColumn; 17 | import javax.persistence.JoinTable; 18 | import javax.persistence.ManyToMany; 19 | import javax.persistence.Table; 20 | 21 | import net.paoding.analysis.analyzer.PaodingAnalyzer; 22 | 23 | import org.hibernate.annotations.Cache; 24 | import org.hibernate.annotations.CacheConcurrencyStrategy; 25 | import org.hibernate.search.annotations.Analyze; 26 | import org.hibernate.search.annotations.Analyzer; 27 | import org.hibernate.search.annotations.Boost; 28 | import org.hibernate.search.annotations.CacheFromIndex; 29 | import org.hibernate.search.annotations.DateBridge; 30 | import org.hibernate.search.annotations.DocumentId; 31 | import org.hibernate.search.annotations.Field; 32 | import org.hibernate.search.annotations.Index; 33 | import org.hibernate.search.annotations.Indexed; 34 | import org.hibernate.search.annotations.IndexedEmbedded; 35 | import org.hibernate.search.annotations.Resolution; 36 | import org.hibernate.search.annotations.Store; 37 | 38 | @Entity 39 | @Table(catalog="hibernate_search",name="Book") 40 | @Indexed(index="book") 41 | //@Analyzer(impl=IKAnalyzer.class) 42 | @Analyzer(impl=PaodingAnalyzer.class) 43 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 44 | @Boost(2.0f) 45 | @CacheFromIndex( { CLASS, ID } ) 46 | public class Book { 47 | @Id 48 | @GeneratedValue(strategy=GenerationType.AUTO) 49 | @DocumentId 50 | private Integer id; 51 | 52 | @Field(index = Index.YES, analyze = Analyze.YES, store = Store.COMPRESS) 53 | @Boost(1.5f) 54 | private String name; 55 | 56 | @Field(index = Index.YES, analyze = Analyze.YES, store = Store.COMPRESS) 57 | @Boost(1.2f) 58 | private String description; 59 | 60 | @Field(index = Index.YES, analyze = Analyze.NO, store = Store.YES) 61 | @DateBridge(resolution = Resolution.DAY) 62 | private Date publicationDate; 63 | 64 | @IndexedEmbedded(depth=1) 65 | @ManyToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE},fetch=FetchType.LAZY) 66 | @JoinTable( 67 | catalog="hibernate_search", 68 | name="Book_Author", 69 | joinColumns={@JoinColumn(name = "book_id")}, 70 | inverseJoinColumns = {@JoinColumn(name = "author_id")} 71 | ) 72 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 73 | private Set authors = new HashSet(); 74 | 75 | public Integer getId() { 76 | return id; 77 | } 78 | 79 | public void setId(Integer id) { 80 | this.id = id; 81 | } 82 | 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | public void setName(String name) { 88 | this.name = name; 89 | } 90 | 91 | public String getDescription() { 92 | return description; 93 | } 94 | 95 | public void setDescription(String description) { 96 | this.description = description; 97 | } 98 | 99 | public Date getPublicationDate() { 100 | return publicationDate; 101 | } 102 | 103 | public void setPublicationDate(Date publicationDate) { 104 | this.publicationDate = publicationDate; 105 | } 106 | 107 | public Set getAuthors() { 108 | return authors; 109 | } 110 | 111 | public void setAuthors(Set authors) { 112 | this.authors = authors; 113 | } 114 | 115 | public Book() { 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/model/QueryResult.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/model/QueryResult.java -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/service/BookService.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.hibernate.example.service; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.lucene.analysis.Analyzer; 6 | import org.hibernate.search.hibernate.example.model.Book; 7 | import org.hibernate.search.hibernate.example.model.QueryResult; 8 | 9 | public interface BookService { 10 | 11 | void add(Book book); 12 | 13 | Book load(int id); 14 | 15 | List query(int start,int pagesize); 16 | void update(Book book); 17 | void delete(Book book); 18 | void delete(int id); 19 | /** 20 | * 21 | * @param keyword 22 | * @param start 23 | * @param pagesize 24 | * @param analyzer 25 | * @param field 26 | * @return 27 | * @throws Exception 28 | */ 29 | QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer,String...field) throws Exception; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/java/org/hibernate/search/hibernate/example/service/impl/BookServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.hibernate.example.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.apache.lucene.analysis.Analyzer; 8 | import org.hibernate.search.hibernate.example.dao.BookDao; 9 | import org.hibernate.search.hibernate.example.model.Book; 10 | import org.hibernate.search.hibernate.example.model.QueryResult; 11 | import org.hibernate.search.hibernate.example.service.BookService; 12 | import org.springframework.stereotype.Service; 13 | 14 | @Service(value="bookServiceImpl") 15 | public class BookServiceImpl implements BookService { 16 | 17 | @Resource(name="bookDaoImpl") 18 | private BookDao bookDao; 19 | 20 | @Override 21 | public void add(Book book) { 22 | bookDao.add(book); 23 | } 24 | 25 | @Override 26 | public List query(int start, int pagesize) { 27 | return bookDao.query(start, pagesize); 28 | } 29 | 30 | @Override 31 | public void update(Book book) { 32 | bookDao.update(book); 33 | } 34 | 35 | @Override 36 | public void delete(Book book) { 37 | bookDao.delete(book); 38 | } 39 | 40 | @Override 41 | public void delete(int id) { 42 | bookDao.delete(id); 43 | } 44 | 45 | @Override 46 | public QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer, String... field) throws Exception { 47 | return bookDao.query(keyword, start, pagesize, analyzer, field); 48 | } 49 | 50 | @Override 51 | public Book load(int id) { 52 | return bookDao.load(id); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/IKAnalyzer.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IK Analyzer 扩展配置 5 | 8 | 9 | stopword.dic; 10 | 11 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | org.hibernate.dialect.MySQL5InnoDBDialect 77 | 78 | 79 | 20 80 | 81 | 82 | true 83 | true 84 | org.hibernate.cache.EhCacheProvider 85 | org.hibernate.cache.ehcache.EhCacheRegionFactory 86 | ehcache.xml 87 | 88 | 89 | LUCENE_36 90 | filesystem 91 | target/lucene/indexes 92 | 93 | 94 | 1000 95 | 100 96 | 97 | 98 | 99 | 100 | 101 | org.hibernate.search.hibernate.example.model 102 | 103 | 104 | 105 | 113 | 114 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/administrative.dic: -------------------------------------------------------------------------------- 1 | 人事部 2 | 信息产业部 3 | 农业部 4 | 医管局 5 | 发改委 6 | 国土资源部 7 | 国防部 8 | 外交部 9 | 教育部 10 | 文化部 11 | 民政部 12 | 能源部 13 | 能源部 14 | 财政部 15 | 铁道部 16 | 防卫厅 17 | 防卫省 18 | 革命委员会 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/appellation.dic: -------------------------------------------------------------------------------- 1 | 中队长 2 | 主任 3 | 主席 4 | 军长 5 | 医生 6 | 博士 7 | 厂长 8 | 司令 9 | 大队长 10 | 夫人 11 | 小队长 12 | 局长 13 | 师傅 14 | 师长 15 | 总统 16 | 指导 17 | 排长 18 | 教授 19 | 教练 20 | 旅长 21 | 校长 22 | 班长 23 | 秘书 24 | 组长 25 | 经理 26 | 老师 27 | 营长 28 | 董事 29 | 董事长 30 | 连长 31 | 队长 32 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/company.dic: -------------------------------------------------------------------------------- 1 | 中国中央电视台 2 | 中国电信有限公司 3 | 中国移动通讯有限公司 4 | 中国网通有限公司 5 | 中国联合通讯有限公司 6 | 中国联通 7 | 中央电视台 8 | 北京百度科技发展有限公司 9 | 央视 10 | 电信 11 | 百度 12 | 移动 13 | 网通 14 | 联通 15 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/comupter-science.dic: -------------------------------------------------------------------------------- 1 | 主板 2 | 内存 3 | 键盘 4 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/contemporary-words.dic: -------------------------------------------------------------------------------- 1 | 支付宝 2 | 斑竹 3 | 站长 4 | 贝宝 5 | 陶宝 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/africa.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/africa.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/america.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/america.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/europe.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/europe.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/japan.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/japan.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/korea.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/korea.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/oceania.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/oceania.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/readme.txt: -------------------------------------------------------------------------------- 1 | 地区划分在此记录 2 | 比如中国的省市县,国外的洲、河流等 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/division/taiwan.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/division/taiwan.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/festival.dic: -------------------------------------------------------------------------------- 1 | 七七纪念日 2 | 七夕 3 | 七夕情人节 4 | 七夕节 5 | 万圣节 6 | 世界人权日 7 | 世界儿歌节 8 | 世界儿童节 9 | 世界动物日 10 | 世界卫生日 11 | 世界地球日 12 | 世界教师日 13 | 世界无烟日 14 | 世界无童工日 15 | 世界林业节 16 | 世界森林日 17 | 世界水日 18 | 世界海洋日 19 | 世界湿地日 20 | 世界献血日 21 | 世界环境日 22 | 世界电视日 23 | 世界睡眠日 24 | 世界粮食日 25 | 世界精神卫生日 26 | 世界红十字日 27 | 世界问候日 28 | 中国人民抗日战争纪念日 29 | 中国国耻日 30 | 中国学生营养日 31 | 中国爱牙日 32 | 中国爱耳日 33 | 中国青年志愿者服务日 34 | 中国青年节 35 | 中秋 36 | 中秋节 37 | 人口日 38 | 人权日 39 | 儿歌节 40 | 儿童节 41 | 元宵 42 | 元宵节 43 | 元旦 44 | 党生日 45 | 全国中小学生安全教育日 46 | 全国助残日 47 | 全国爱眼日 48 | 全国爱耳日 49 | 六十亿人口日 50 | 六四纪念日 51 | 冬至 52 | 减轻自然灾害日 53 | 动物日 54 | 助残日 55 | 劳动妇女节 56 | 劳动节 57 | 博物馆日 58 | 卫生日 59 | 和平日 60 | 国庆 61 | 国庆节 62 | 国耻日 63 | 国际儿童节 64 | 国际减轻自然灾害日 65 | 国际劳动妇女节 66 | 国际劳动节 67 | 国际博物馆日 68 | 国际和平日 69 | 国际奥林匹克日 70 | 国际妇女节 71 | 国际容忍日 72 | 国际左撇子日 73 | 国际志愿者日 74 | 国际护士节 75 | 国际无车日 76 | 国际残疾人日 77 | 国际母语日 78 | 国际气象节 79 | 国际消费者权益日 80 | 国际牛奶日 81 | 国际盲人节 82 | 国际禁毒日 83 | 国际老人日 84 | 国际臭氧层保护日 85 | 国际非洲儿童日 86 | 国际音乐日 87 | 国际麻风日 88 | 圣诞节 89 | 地球日 90 | 处暑 91 | 复活节 92 | 夏至 93 | 大寒 94 | 大暑 95 | 大雪 96 | 奥林匹克日 97 | 妇女节 98 | 学生营养日 99 | 安全教育日 100 | 安全日 101 | 容忍日 102 | 寒露 103 | 小寒 104 | 小年 105 | 小暑 106 | 小满 107 | 小雪 108 | 左撇子日 109 | 平安夜 110 | 建党日 111 | 建军节 112 | 志愿人员日 113 | 志愿者日 114 | 情人节 115 | 惊蛰 116 | 愚人节 117 | 感恩节 118 | 扫房日 119 | 抗日战争纪念日 120 | 抗日纪念日 121 | 护士节 122 | 教师日 123 | 教师节 124 | 文化遗产日 125 | 无烟日 126 | 无童工日 127 | 无车日 128 | 春分 129 | 春节 130 | 植树节 131 | 残疾人日 132 | 母亲节 133 | 母语日 134 | 气象节 135 | 水日 136 | 海洋日 137 | 消费者权益日 138 | 清明 139 | 清明节 140 | 湿地日 141 | 爱牙日 142 | 爱眼日 143 | 爱耳日 144 | 父亲节 145 | 牛奶日 146 | 独立日 147 | 献血日 148 | 环境日 149 | 电视日 150 | 白露 151 | 盲人节 152 | 睡眠日 153 | 秋分 154 | 立冬 155 | 立夏 156 | 立春 157 | 立秋 158 | 端午节 159 | 粮食日 160 | 精神卫生日 161 | 红十字日 162 | 老人日 163 | 联合国日 164 | 腊八节 165 | 腊日 166 | 臭氧保护日 167 | 臭氧层保护日 168 | 芒种 169 | 营养日 170 | 谷雨 171 | 重阳 172 | 重阳节 173 | 问候日 174 | 除夕 175 | 雨水 176 | 霜降 177 | 青年志愿者服务日 178 | 青年节 179 | 非洲儿童日 180 | 音乐日 181 | 麻风日 182 | 龙头节 183 | -182 184 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/language.dic: -------------------------------------------------------------------------------- 1 | 中文 2 | 台湾话 3 | 台语 4 | 客家话 5 | 汉字 6 | 汉语 7 | 法文 8 | 法语 9 | 福建话 10 | 粤语 11 | 美语 12 | 英文 13 | 英语 14 | 西班牙语 15 | 闽南语 16 | -15 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/locale/beijing.dic: -------------------------------------------------------------------------------- 1 | 健翔桥 2 | 北医大 3 | 四惠东 4 | 复兴门 5 | 天安门 6 | 德胜门 7 | 德胜门西 8 | 新街口 9 | 朝阳门 10 | 正阳门 11 | 水立方 12 | 积水潭 13 | 积水潭桥 14 | 苹果园 15 | 西直门 16 | 长安街 17 | -15 18 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/locale/quanzhou.dic: -------------------------------------------------------------------------------- 1 | 东西塔 2 | 崇武 3 | 惠安 4 | 洛阳桥 5 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/locale/readme.txt: -------------------------------------------------------------------------------- 1 | 各地方街道等在此录入 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/locale/xiamen.dic: -------------------------------------------------------------------------------- 1 | 思明区 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/name-foreign.dic: -------------------------------------------------------------------------------- 1 | 亚历山大 2 | 克林顿 3 | 克里斯汀 4 | 布什 5 | 布莱尔 6 | 科特勒 7 | 约翰 8 | 约翰逊 9 | 蒂娜 10 | -11 11 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/nation.dic: -------------------------------------------------------------------------------- 1 | 东非 2 | 中华 3 | 中华 4 | 中华人民共和国 5 | 中华民国 6 | 中国 7 | 中国 8 | 中非 9 | 乌克兰 10 | 也门 11 | 以色列 12 | 伊拉克 13 | 伊朗 14 | 俄罗斯 15 | 分类 16 | 加拿大 17 | 南非 18 | 古巴 19 | 台湾 20 | 埃及 21 | 塞尔维亚 22 | 墨西哥 23 | 威尔士 24 | 尼日利亚 25 | 巴比伦 26 | 希腊 27 | 德国 28 | 德意志 29 | 意大利 30 | 捷克 31 | 日本 32 | 朝鲜 33 | 比利时 34 | 法兰西 35 | 法国 36 | 波兰 37 | 波黑 38 | 瑞典 39 | 瑞士 40 | 白俄罗斯 41 | 缅甸 42 | 美利坚 43 | 美利坚合众国 44 | 美国 45 | 老挝 46 | 苏格兰 47 | 苏联 48 | 英国 49 | 英格兰 50 | 葡萄牙 51 | 蒙古 52 | 西班牙 53 | 越南 54 | 韩国 55 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/org-domestic.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/dic/org-domestic.dic -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/org-foreign.dic: -------------------------------------------------------------------------------- 1 | 上海合作组织 2 | 世卫 3 | 世界卫生组织 4 | 世界银行 5 | 东盟 6 | 亚太经合组织 7 | 人权理事会 8 | 六方会谈 9 | 北约 10 | 哈马斯 11 | 安全理事会 12 | 安理会 13 | 欧佩克 14 | 红十字会 15 | 联合国 16 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/paoding-dic-names.properties: -------------------------------------------------------------------------------- 1 | #dictionary character encoding 2 | #paoding.dic.charset=UTF-8 3 | 4 | ### Set maximum word length (Chinese character) that analyzer can support. Longer words will be ignored. 5 | ### By default, it is set to "0", which means all words will be analyzed. 6 | #paoding.dic.maxWordLen=0 7 | 8 | #dictionaries which are skip 9 | #paoding.dic.skip.prefix=x- 10 | 11 | #chinese/cjk charactors that will not token 12 | #paoding.dic.noise-charactor=x-noise-charactor 13 | 14 | #chinese/cjk words that will not token 15 | #paoding.dic.noise-word=x-noise-word 16 | 17 | #unit words, like "ge", "zhi", ... 18 | #paoding.dic.unit=x-unit 19 | 20 | #like "Wang", "Zhang", ... 21 | #paoding.dic.confucian-family-name=x-confucian-family-name 22 | 23 | #linke "uPAN", "cdHE" 24 | #paoding.dic.for-combinatorics=x-for-combinatorics 25 | 26 | 27 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/star-domestic.dic: -------------------------------------------------------------------------------- 1 | 丁俊辉 2 | 乾隆 3 | 刘德华 4 | 刘翔 5 | 华仔 6 | 周杰伦 7 | 姚明 8 | 小丁 9 | 小辉 10 | 庖丁 11 | 康熙 12 | 张学友 13 | 朱军 14 | 朱德 15 | 朱德茂 16 | 朱镕基 17 | 李世民 18 | 李瑞环 19 | 武则天 20 | 毛主席 21 | 毛泽东 22 | 江泽民 23 | 老许 24 | 胡志明 25 | 胡锦涛 26 | 许静蕾 27 | 诸葛亮 28 | 赵本山 29 | 陈佩斯 30 | 马云 31 | 马加爵 32 | -30 33 | #历史、政治、学术、企业、娱乐、体育、社会现象 34 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/star-foreign.dic: -------------------------------------------------------------------------------- 1 | 比尔 2 | 盖茨 3 | -2 4 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/x-confucian-family-name.dic: -------------------------------------------------------------------------------- 1 | 丁 2 | 万 3 | 上官 4 | 丘 5 | 东郭 6 | 严 7 | 丰 8 | 乃 9 | 乌 10 | 乐 11 | 乔 12 | 习 13 | 云 14 | 亚 15 | 什 16 | 仇 17 | 仝 18 | 任 19 | 伊 20 | 伍 21 | 伏 22 | 休 23 | 伦 24 | 伯 25 | 何 26 | 佘 27 | 余 28 | 佟 29 | 佩 30 | 侯 31 | 俄 32 | 保 33 | 俞 34 | 倪 35 | 傅 36 | 储 37 | 元 38 | 克 39 | 公孙 40 | 兰 41 | 关 42 | 兹 43 | 内 44 | 冈 45 | 冉 46 | 农 47 | 冯 48 | 况 49 | 冷 50 | 冼 51 | 凌 52 | 凤 53 | 凯 54 | 刀 55 | 刁 56 | 切 57 | 刘 58 | 利 59 | 加 60 | 努 61 | 励 62 | 劳 63 | 勒 64 | 勾 65 | 包 66 | 匡 67 | 匹 68 | 华 69 | 卓 70 | 单 71 | 单于 72 | 博 73 | 卜 74 | 卞 75 | 卡 76 | 卢 77 | 卫 78 | 印 79 | 危 80 | 厄 81 | 厉 82 | 及 83 | 古 84 | 可 85 | 史 86 | 叶 87 | 司徒 88 | 司空 89 | 司马 90 | 合 91 | 吉 92 | 吕 93 | 吴 94 | 周 95 | 哈 96 | 哥 97 | 唐 98 | 商 99 | 喀 100 | 喻 101 | 图 102 | 土 103 | 坦 104 | 埃 105 | 基 106 | 塔 107 | 塞 108 | 墨 109 | 夏 110 | 多 111 | 大 112 | 夫 113 | 奇 114 | 奚 115 | 奥 116 | 姆 117 | 姚 118 | 姜 119 | 姬 120 | 娄 121 | 孔 122 | 孙 123 | 孟 124 | 季 125 | 安 126 | 宋 127 | 宗 128 | 官 129 | 宝 130 | 宣 131 | 宫 132 | 容 133 | 宾 134 | 寿 135 | 封 136 | 尉 137 | 小泉 138 | 尔 139 | 尤 140 | 尹 141 | 尼 142 | 居 143 | 屈 144 | 屠 145 | 岑 146 | 岳 147 | 崔 148 | 左 149 | 巫 150 | 巴 151 | 布 152 | 希 153 | 帕 154 | 常 155 | 平 156 | 幸 157 | 庄 158 | 库 159 | 应 160 | 庞 161 | 康 162 | 廉 163 | 廖 164 | 延 165 | 弗 166 | 张 167 | 强 168 | 彦 169 | 彭 170 | 徐 171 | 德 172 | 慕容 173 | 戈 174 | 成 175 | 戚 176 | 戴 177 | 房 178 | 托 179 | 拉 180 | 招 181 | 摩 182 | 敖 183 | 斐 184 | 斯 185 | 方 186 | 於 187 | 昌 188 | 明 189 | 易 190 | 晋 191 | 晏 192 | 普 193 | 曹 194 | 曼 195 | 曾 196 | 朗 197 | 朱 198 | 朴 199 | 权 200 | 李 201 | 杜 202 | 来 203 | 杨 204 | 杭 205 | 杰 206 | 林 207 | 柏 208 | 查 209 | 柯 210 | 柳 211 | 柴 212 | 根 213 | 格 214 | 桂 215 | 桑 216 | 梁 217 | 梅 218 | 森 219 | 楚 220 | 楼 221 | 樊 222 | 欧阳 223 | 武 224 | 段 225 | 殷 226 | 比 227 | 毕 228 | 毛 229 | 江 230 | 池 231 | 汤 232 | 汪 233 | 沃 234 | 沈 235 | 沙 236 | 法 237 | 波 238 | 泰 239 | 泽 240 | 洛 241 | 洪 242 | 浦 243 | 涂 244 | 淳 245 | 温 246 | 游 247 | 湛 248 | 溥 249 | 滕 250 | 满 251 | 潘 252 | 澳 253 | 澹台 254 | 烈 255 | 焦 256 | 熊 257 | 燕 258 | 爱 259 | 爱新觉罗 260 | 牛 261 | 牟 262 | 特 263 | 狄 264 | 王 265 | 班 266 | 理 267 | 瑞 268 | 瑶 269 | 瓦 270 | 甄 271 | 甘 272 | 田 273 | 申 274 | 登 275 | 白 276 | 皇甫 277 | 皮 278 | 盖 279 | 盛 280 | 瞿 281 | 石 282 | 祁 283 | 祖 284 | 祝 285 | 福 286 | 禹 287 | 禾 288 | 科 289 | 秦 290 | 程 291 | 稽 292 | 穆 293 | 空 294 | 窦 295 | 章 296 | 端 297 | 竺 298 | 简 299 | 管 300 | 米 301 | 索 302 | 累 303 | 纪 304 | 纳 305 | 练 306 | 维 307 | 缪 308 | 罗 309 | 翁 310 | 翟 311 | 翦 312 | 耶 313 | 耿 314 | 聂 315 | 胡 316 | 胥 317 | 腓 318 | 腾 319 | 臧 320 | 舍 321 | 舒 322 | 良 323 | 艾 324 | 芬 325 | 芮 326 | 花 327 | 苏 328 | 苗 329 | 苟 330 | 英 331 | 范 332 | 茅 333 | 茨 334 | 荀 335 | 荆 336 | 荣 337 | 莫 338 | 莱 339 | 萧 340 | 萨 341 | 董 342 | 蒂 343 | 蒋 344 | 蒙 345 | 蒲 346 | 蓝 347 | 蓬 348 | 蔚 349 | 蔡 350 | 薛 351 | 虞 352 | 蚁 353 | 衡 354 | 袁 355 | 裘 356 | 裴 357 | 褚 358 | 西 359 | 解 360 | 言 361 | 詹 362 | 许 363 | 诸 364 | 诸葛 365 | 诺 366 | 谈 367 | 谢 368 | 谭 369 | 谷 370 | 贝 371 | 费 372 | 贺 373 | 贾 374 | 赖 375 | 赛 376 | 赫 377 | 赵 378 | 路 379 | 辛 380 | 辜 381 | 边 382 | 达 383 | 迈 384 | 连 385 | 迟 386 | 迪 387 | 逊 388 | 邓 389 | 邝 390 | 邢 391 | 那 392 | 邬 393 | 邰 394 | 邱 395 | 邵 396 | 邹 397 | 郁 398 | 郎 399 | 郑 400 | 郝 401 | 郭 402 | 都 403 | 里 404 | 金 405 | 钟 406 | 钮 407 | 钱 408 | 银 409 | 闵 410 | 闻 411 | 阎 412 | 阮 413 | 阳 414 | 阿 415 | 陆 416 | 陈 417 | 陶 418 | 隆 419 | 雅 420 | 雷 421 | 霍 422 | 靳 423 | 韦 424 | 韩 425 | 项 426 | 顾 427 | 颜 428 | 饶 429 | 马 430 | 骆 431 | 高 432 | 魏 433 | 鱼 434 | 鲁 435 | 鲍 436 | 鲜 437 | 麦 438 | 麻 439 | 黄 440 | 黎 441 | 黛 442 | 齐 443 | 龙 444 | 龚 445 | -444 446 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/x-for-combinatorics.dic: -------------------------------------------------------------------------------- 1 | U盘 2 | CD盒 3 | CD机 4 | C盘 5 | D盘 6 | E盘 7 | F盘 8 | G盘 9 | H盘 10 | I盘 11 | J盘 12 | K盘 13 | Z盘 14 | K歌之王 15 | A座 16 | B座 17 | C座 18 | D座 19 | E座 20 | F座 21 | A计划 22 | B计划 23 | B超 24 | Q版 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/x-noise-charactor.dic: -------------------------------------------------------------------------------- 1 | 的 2 | 一 3 | 不 4 | 在 5 | 人 6 | 有 7 | 是 8 | 为 9 | 以 10 | 于 11 | 上 12 | 他 13 | 而 14 | 后 15 | 之 16 | 来 17 | 及 18 | 了 19 | 因 20 | 下 21 | 可 22 | 到 23 | 由 24 | 这 25 | 与 26 | 也 27 | 此 28 | 但 29 | 并 30 | 个 31 | 其 32 | 已 33 | 无 34 | 小 35 | 我 36 | 们 37 | 起 38 | 最 39 | 再 40 | 今 41 | 去 42 | 好 43 | 只 44 | 又 45 | 或 46 | 很 47 | 亦 48 | 某 49 | 把 50 | 那 51 | 你 52 | 乃 53 | 它 54 | 吧 55 | 被 56 | 比 57 | 别 58 | 趁 59 | 当 60 | 从 61 | 到 62 | 得 63 | 打 64 | 凡 65 | 儿 66 | 尔 67 | 该 68 | 各 69 | 给 70 | 跟 71 | 和 72 | 何 73 | 还 74 | 即 75 | 几 76 | 既 77 | 看 78 | 据 79 | 距 80 | 靠 81 | 啦 82 | 了 83 | 另 84 | 么 85 | 每 86 | 们 87 | 嘛 88 | 拿 89 | 哪 90 | 那 91 | 您 92 | 凭 93 | 且 94 | 却 95 | 让 96 | 仍 97 | 啥 98 | 如 99 | 若 100 | 使 101 | 谁 102 | 虽 103 | 随 104 | 同 105 | 所 106 | 她 107 | 哇 108 | 嗡 109 | 往 110 | 哪 111 | 些 112 | 向 113 | 沿 114 | 哟 115 | 用 116 | 于 117 | 咱 118 | 则 119 | 怎 120 | 曾 121 | 至 122 | 致 123 | 着 124 | 诸 125 | 自 -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/x-noise-word.dic: -------------------------------------------------------------------------------- 1 | 你们 2 | 那样 3 | 所以 4 | 得了 5 | 当地 6 | 有关 7 | 所有 8 | 因之 9 | 用来 10 | 所在 11 | 对待 12 | 而外 13 | 分别 14 | 某些 15 | 对方 16 | 不只 17 | 虽然 18 | 无论 19 | 不论 20 | 无论如何 21 | 但是 22 | 全部 23 | 尽管 24 | 大家 25 | 以便 26 | 自己 27 | 可是 28 | 反之 29 | 这些 30 | 什么 31 | 由此 32 | 万一 33 | 而已 34 | 何以 35 | 咱们 36 | 值此 37 | 向着 38 | 哪怕 39 | 倘若 40 | 出于 41 | 如上 42 | 如若 43 | 替代 44 | 什么样 45 | 如是 46 | 照着 47 | 此处 48 | 这样 49 | 每当 50 | 此次 51 | 至于 52 | 此地 53 | 要不然 54 | 逐步 55 | 格里斯 56 | 本地 57 | 要不 58 | 其次 59 | 尽管如此 60 | 遵循 61 | 乃至 62 | 若是 63 | 并且 64 | 如下 65 | 可以 66 | 才能 67 | 以及 68 | 彼此 69 | 根据 70 | 随后 71 | 有时 72 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dic/x-unit.dic: -------------------------------------------------------------------------------- 1 | 万 2 | 世 3 | 世纪 4 | 两 5 | 个 6 | 中 7 | 乘 8 | 井 9 | 亩 10 | 人 11 | 人工作日 12 | 人日 13 | 人月日 14 | 亿 15 | 仙 16 | 代 17 | 件 18 | 份 19 | 伏 20 | 伏特 21 | 位 22 | 例 23 | 倍 24 | 元 25 | 兆 26 | 光年 27 | 克 28 | 党 29 | 公顷 30 | 册 31 | 出 32 | 分 33 | 分钟 34 | 划 35 | 列 36 | 刻 37 | 剧 38 | 包 39 | 匹 40 | 区 41 | 千 42 | 升 43 | 单 44 | 卫 45 | 卷 46 | 厂 47 | 厅 48 | 厨 49 | 口 50 | 句 51 | 只 52 | 台 53 | 号 54 | 吨 55 | 员 56 | 周 57 | 周岁 58 | 周年 59 | 品 60 | 回 61 | 团 62 | 国 63 | 圆 64 | 圈 65 | 场 66 | 坪 67 | 堆 68 | 堵 69 | 声 70 | 壶 71 | 处 72 | 夜 73 | 大 74 | 天 75 | 头 76 | 女 77 | 孔 78 | 季 79 | 安 80 | 安培 81 | 宗 82 | 室 83 | 家 84 | 寸 85 | 尺 86 | 尾 87 | 局 88 | 层 89 | 届 90 | 岁 91 | 市 92 | 带 93 | 幅 94 | 幕 95 | 平方米 96 | 年 97 | 年级 98 | 床 99 | 店 100 | 度 101 | 座 102 | 弄 103 | 式 104 | 张 105 | 微克 106 | 微秒 107 | 微米 108 | 快 109 | 成 110 | 房 111 | 批 112 | 把 113 | 折 114 | 抽 115 | 捧 116 | 撮 117 | 支 118 | 斤 119 | 族 120 | 日 121 | 时 122 | 晚 123 | 曲 124 | 月 125 | 期 126 | 本 127 | 朵 128 | 束 129 | 条 130 | 杯 131 | 柜 132 | 栋 133 | 样 134 | 根 135 | 桌 136 | 桶 137 | 楼 138 | 次 139 | 步 140 | 段 141 | 毫 142 | 毫克 143 | 毫分 144 | 毫升 145 | 毫秒 146 | 毫米 147 | 洞 148 | 派 149 | 滴 150 | 点 151 | 片 152 | 牛 153 | 环 154 | 班 155 | 瓶 156 | 男 157 | 盏 158 | 盒 159 | 盘 160 | 种 161 | 科 162 | 秒 163 | 秒钟 164 | 立方米 165 | 站 166 | 章 167 | 笔 168 | 等 169 | 箱 170 | 米 171 | 粒 172 | 级 173 | 线 174 | 维 175 | 缸 176 | 群 177 | 翻 178 | 艘 179 | 节 180 | 英寸 181 | 行 182 | 袋 183 | 角 184 | 课 185 | 路 186 | 车 187 | 轮 188 | 辆 189 | 辈 190 | 辑 191 | 道 192 | 部 193 | 里 194 | 重 195 | 针 196 | 钱 197 | 门 198 | 间 199 | 阶 200 | 隔 201 | 集 202 | 面 203 | 页 204 | 颗 205 | 首 206 | -205 207 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/dispatcherServlet-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 17 | 18 | 23 | 24 | 25 | 26 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | com.mysql.jdbc.Driver 9 | jdbc:mysql://127.0.0.1:3306/hibernate_search 10 | travis 11 | org.hibernate.dialect.MySQL5InnoDBDialect 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/hibernate_search.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/main/resources/hibernate_search.sql -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | #log4jdbc# 2 | #url=jdbc:log4jdbc:mysql://localhost:3306/framework 3 | #driverClassName=net.sf.log4jdbc.DriverSpy 4 | 5 | #P6Spy# 6 | #url=jdbc:mysql://localhost:3306/framework 7 | #driverClassName=com.p6spy.engine.spy.P6SpyDriver 8 | 9 | log4jdbc.driverClassName=net.sf.log4jdbc.DriverSpy 10 | P6Spy.driverClassName=com.p6spy.engine.spy.P6SpyDriver 11 | 12 | username=travis 13 | password 14 | 15 | 16 | log4jdbc.url=jdbc:log4jdbc:mysql://127.0.0.1:3306/hibernate_search 17 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | logs/hibernate-search-hibernate.log 13 | 14 | logs/hibernate-search-hibernate.%d{yyyy-MM-dd}.log 15 | 16 | 17 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/org/hibernate/search/hibernate/example/model/Author.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/org/hibernate/search/hibernate/example/model/Book.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/paoding-dic-home.properties: -------------------------------------------------------------------------------- 1 | 2 | #values are "system-env" or "this"; 3 | #if value is "this" , using the paoding.dic.home as dicHome if configed! 4 | #paoding.dic.home.config-fisrt=system-env 5 | 6 | #dictionary home (directory) 7 | #"classpath:xxx" means dictionary home is in classpath. 8 | #e.g "classpath:dic" means dictionaries are in "classes/dic" directory or any other classpath directory 9 | paoding.dic.home=classpath:dic 10 | 11 | #seconds for dic modification detection 12 | #paoding.dic.detector.interval=60 13 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/resources/stopword.dic: -------------------------------------------------------------------------------- 1 | a 2 | an 3 | and 4 | are 5 | as 6 | at 7 | be 8 | but 9 | by 10 | for 11 | if 12 | in 13 | into 14 | is 15 | it 16 | no 17 | not 18 | of 19 | on 20 | or 21 | such 22 | that 23 | the 24 | their 25 | then 26 | there 27 | these 28 | they 29 | this 30 | to 31 | was 32 | will 33 | with -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/webapp/WEB-INF/views/error/401.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> 3 | 4 | 5 | 6 | Access Denied 7 | 15 | 16 | 17 |
18 |

Access Denied

19 |
20 |

访问被拒绝

21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/webapp/WEB-INF/views/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | <%response.setStatus(200);%> 5 | 6 | 7 | 8 | 9 | 404 - 页面不存在 10 | 15 | 16 | 17 | 18 |
19 |

404公益页面

20 | 21 |

">返回首页

22 |
23 | 24 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/webapp/WEB-INF/views/error/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ page import="org.slf4j.Logger,org.slf4j.LoggerFactory" %> 4 | <%response.setStatus(200);%> 5 | 6 | <% 7 | Throwable ex = null; 8 | if (exception != null) 9 | ex = exception; 10 | if (request.getAttribute("javax.servlet.error.exception") != null) 11 | ex = (Throwable) request.getAttribute("javax.servlet.error.exception"); 12 | 13 | //记录日志 14 | Logger logger = LoggerFactory.getLogger("500.jsp"); 15 | logger.error(ex.getMessage(), ex); 16 | %> 17 | 18 | 19 | 20 | 21 | 500 - 系统内部错误 22 | 23 | 24 | 25 |

500 - 系统发生内部错误.

26 |

">返回首页

27 | 28 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/webapp/WEB-INF/views/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | 7 | Hibernate Search Example 8 | 9 | 39 | 40 | 41 |

Spring3.2+Hibernate4.2+Hibernate Search4.2整合(IKAnalyzer、paoding)实现中文分词索引实时同步

42 |
43 | 搜索: 44 |
45 | 46 | 47 | 48 | 49 |
50 |
51 |
52 | 新增: 53 |
54 | 书名:
55 | 作者:
56 | 作者:
57 | 描述:
58 | 59 |
60 |
61 | 修改: 62 |
63 | 64 | 书名:
65 | 作者:
66 | 作者:
67 | 描述:
68 | 69 |
70 | 71 |
72 | 73 | 共查到[${queryResult.searchresultsize}]处结果!
74 | 75 | 编号 :
76 | 书名 :
77 | 作者 : 78 | 79 |   80 |
81 | 描述 :
82 | 出版日期 :
83 | 删除 84 | 修改 85 |
86 |
87 |
88 | 89 | 没有要查询的内容! 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | hibernate-search-hibernate 4 | 5 | 6 | org.springframework.web.context.ContextLoaderListener 7 | 8 | 9 | 10 | org.springframework.web.util.IntrospectorCleanupListener 11 | 12 | 13 | 14 | contextConfigLocation 15 | classpath:applicationContext.xml 16 | 17 | 18 | 19 | 20 | encodingFilter 21 | org.springframework.web.filter.CharacterEncodingFilter 22 | 23 | encoding 24 | UTF-8 25 | 26 | 27 | forceEncoding 28 | true 29 | 30 | 31 | 32 | encodingFilter 33 | /* 34 | 35 | 36 | 37 | 38 | 39 | openSessionInViewFilter 40 | org.springframework.orm.hibernate4.support.OpenSessionInViewFilter 41 | 42 | sessionFactoryBeanName 43 | hibernate4sessionFactory 44 | 45 | 46 | 47 | singleSession 48 | true 49 | 50 | 51 | 52 | flushMode 53 | AUTO 54 | 55 | 56 | 57 | openSessionInViewFilter 58 | /* 59 | 60 | 61 | 62 | 63 | DruidWebStatFilter 64 | com.alibaba.druid.support.http.WebStatFilter 65 | 66 | exclusions 67 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 68 | 69 | 70 | sessionStatMaxCount 71 | 1000 72 | 73 | 74 | sessionStatEnable 75 | true 76 | 77 | 78 | profileEnable 79 | true 80 | 81 | 82 | 83 | DruidWebStatFilter 84 | /* 85 | 86 | 87 | 88 | 89 | 90 | DruidStatView 91 | com.alibaba.druid.support.http.StatViewServlet 92 | 93 | 94 | DruidStatView 95 | /druid/* 96 | 97 | 98 | 99 | 100 | 101 | dispatcherServlet 102 | org.springframework.web.servlet.DispatcherServlet 103 | 104 | contextConfigLocation 105 | classpath:dispatcherServlet-servlet.xml 106 | 107 | 1 108 | 109 | 110 | 111 | dispatcherServlet 112 | / 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 401 121 | /WEB-INF/views/error/401.jsp 122 | 123 | 124 | 125 | 404 126 | /WEB-INF/views/error/404.jsp 127 | 128 | 129 | 130 | 500 131 | /WEB-INF/views/error/500.jsp 132 | 133 | 134 | 135 | 30 136 | 137 | 138 | 143 | -------------------------------------------------------------------------------- /hibernate-search-hibernate/src/test/java/org/hibernate/search/hibernate/example/dao/impl/BookDaoImplTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-hibernate/src/test/java/org/hibernate/search/hibernate/example/dao/impl/BookDaoImplTest.java -------------------------------------------------------------------------------- /hibernate-search-jpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | hibernate-search-example 7 | org.hibernate.search.example 8 | 1.0 9 | ../pom.xml 10 | 11 | hibernate-search-jpa 12 | war 13 | hibernate-search-jpa 14 | http://maven.apache.org 15 | 16 | 17 | 18 | org.slf4j 19 | slf4j-api 20 | 21 | 22 | 23 | ch.qos.logback 24 | logback-classic 25 | 26 | 27 | 28 | org.slf4j 29 | log4j-over-slf4j 30 | runtime 31 | 32 | 33 | 34 | org.slf4j 35 | jcl-over-slf4j 36 | runtime 37 | 38 | 39 | 40 | org.slf4j 41 | jul-to-slf4j 42 | runtime 43 | 44 | 45 | 46 | 47 | 48 | 49 | p6spy 50 | p6spy 51 | 52 | 53 | log4jdbc 54 | log4jdbc 55 | 56 | 57 | 58 | junit 59 | junit 60 | 61 | 62 | 63 | javax.servlet 64 | jstl 65 | 66 | 67 | 68 | javax.servlet 69 | servlet-api 70 | provided 71 | 72 | 73 | 74 | javax.servlet.jsp 75 | jsp-api 76 | provided 77 | 78 | 79 | 80 | 81 | org.springframework 82 | spring-webmvc 83 | 84 | 85 | 86 | org.springframework 87 | spring-orm 88 | 89 | 90 | 91 | org.springframework 92 | spring-aop 93 | 94 | 95 | 96 | org.springframework 97 | spring-tx 98 | 99 | 100 | 101 | org.springframework 102 | spring-jdbc 103 | 104 | 105 | 106 | org.springframework 107 | spring-webmvc 108 | 109 | 110 | 111 | org.springframework 112 | spring-web 113 | 114 | 115 | 116 | org.springframework 117 | spring-oxm 118 | 119 | 120 | commons-lang 121 | commons-lang 122 | 123 | 124 | 125 | 126 | 127 | org.springframework 128 | spring-test 129 | 130 | 131 | 132 | org.springframework 133 | spring-aspects 134 | 135 | 136 | 137 | 138 | 139 | org.springframework.data 140 | spring-data-jpa 141 | 142 | 143 | spring-aop 144 | org.springframework 145 | 146 | 147 | 148 | 149 | 150 | 151 | org.hibernate 152 | hibernate-core 153 | 154 | 155 | 156 | org.hibernate 157 | hibernate-ehcache 158 | 159 | 160 | 161 | org.hibernate.javax.persistence 162 | hibernate-jpa-2.0-api 163 | 164 | 165 | 166 | org.hibernate 167 | hibernate-entitymanager 168 | 169 | 170 | 171 | 172 | org.hibernate 173 | hibernate-search 174 | 175 | 176 | 177 | org.hibernate 178 | hibernate-search-analyzers 179 | 180 | 181 | 182 | org.hibernate 183 | hibernate-search-infinispan 184 | 185 | 186 | 187 | net.sf.ehcache 188 | ehcache-core 189 | 190 | 191 | 192 | 193 | IKAnalyzer 194 | IKAnalyzer 195 | 196 | 197 | 198 | net.paoding.analysis.analyzer 199 | paoding-analyzer 200 | 201 | 202 | 203 | 204 | org.hibernate 205 | hibernate-validator 206 | 207 | 208 | 209 | 210 | com.alibaba 211 | druid 212 | 213 | 214 | 215 | 216 | 217 | org.aspectj 218 | aspectjweaver 219 | 220 | 221 | 222 | 223 | org.codehaus.jackson 224 | jackson-mapper-asl 225 | 226 | 227 | 228 | org.codehaus.jackson 229 | jackson-core-asl 230 | 231 | 232 | 233 | mysql 234 | mysql-connector-java 235 | 236 | 237 | 238 | 239 | hibernate-search-jpa 240 | 241 | 242 | org.apache.maven.plugins 243 | maven-compiler-plugin 244 | 245 | 1.5 246 | 1.5 247 | 248 | 249 | 250 | 251 | org.apache.maven.plugins 252 | maven-release-plugin 253 | 254 | 255 | 256 | org.apache.maven.plugins 257 | maven-compiler-plugin 258 | 259 | 1.6 260 | 1.6 261 | 262 | 263 | 264 | 268 | 269 | 270 | org.apache.tomcat.maven 271 | tomcat6-maven-plugin 272 | 273 | 274 | 275 | org.apache.tomcat.maven 276 | tomcat7-maven-plugin 277 | 278 | 279 | 283 | 284 | org.mortbay.jetty 285 | maven-jetty-plugin 286 | 287 | 288 | 293 | 294 | 295 | org.codehaus.mojo 296 | jboss-maven-plugin 297 | 298 | localhost 299 | 8080 300 | D:/jboss-4.2.3.GA 301 | target/maven-framework.war 302 | all 303 | 304 | 305 | 306 | 307 | 311 | 312 | org.jboss.as.plugins 313 | jboss-as-maven-plugin 314 | 315 | 316 | 317 | 318 | org.apache.maven.plugins 319 | maven-eclipse-plugin 320 | 321 | true 322 | false 323 | 2.0 324 | 325 | 326 | 327 | .settings/org.eclipse.core.resources.prefs 328 | 329 | =${project.build.sourceEncoding}${line.separator}]]> 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/IndexManger.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/IndexManger.java -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/SearchManager.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/SearchManager.java -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/controller/BookController.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/controller/BookController.java -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/dao/BookDao.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.jpa.example.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.lucene.analysis.Analyzer; 6 | import org.hibernate.search.jpa.example.model.Book; 7 | import org.hibernate.search.jpa.example.model.QueryResult; 8 | 9 | public interface BookDao { 10 | 11 | void add(Book book); 12 | 13 | Book load(int id); 14 | 15 | List query(int start,int pagesize); 16 | void update(Book book); 17 | void delete(Book book); 18 | void delete(int id); 19 | 20 | /** 21 | * 22 | * @param keyword 23 | * @param start 24 | * @param pagesize 25 | * @param analyzer 26 | * @param field 27 | * @return 28 | * @throws Exception 29 | */ 30 | QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer,String...field) throws Exception; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/dao/impl/BookDaoImpl.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/dao/impl/BookDaoImpl.java -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/model/Author.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.jpa.example.model; 2 | 3 | import java.util.Set; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.FetchType; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.ManyToMany; 11 | import javax.persistence.Table; 12 | 13 | import org.codehaus.jackson.annotate.JsonIgnore; 14 | import org.hibernate.annotations.Cache; 15 | import org.hibernate.annotations.CacheConcurrencyStrategy; 16 | import org.hibernate.search.annotations.Analyze; 17 | import org.hibernate.search.annotations.ContainedIn; 18 | import org.hibernate.search.annotations.Field; 19 | import org.hibernate.search.annotations.Index; 20 | import org.hibernate.search.annotations.Store; 21 | 22 | @Entity 23 | @Table(catalog="hibernate_search",name="Author") 24 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 25 | public class Author { 26 | @Id 27 | @GeneratedValue(strategy=GenerationType.AUTO) 28 | private Integer id; 29 | 30 | @Field(index=Index.YES,analyze=Analyze.NO,store=Store.COMPRESS) 31 | private String name; 32 | 33 | @ManyToMany(fetch=FetchType.LAZY,mappedBy="authors"/*,cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE}*/) 34 | @ContainedIn 35 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 36 | @JsonIgnore 37 | private Set books; 38 | 39 | public Integer getId() { 40 | return id; 41 | } 42 | 43 | public void setId(Integer id) { 44 | this.id = id; 45 | } 46 | 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | public void setName(String name) { 52 | this.name = name; 53 | } 54 | 55 | public Set getBooks() { 56 | return books; 57 | } 58 | 59 | public void setBooks(Set books) { 60 | this.books = books; 61 | } 62 | 63 | public Author() { 64 | } 65 | 66 | public Author(String name) { 67 | super(); 68 | this.name = name; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/model/Book.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.jpa.example.model; 2 | 3 | import static org.hibernate.search.annotations.FieldCacheType.CLASS; 4 | import static org.hibernate.search.annotations.FieldCacheType.ID; 5 | 6 | import java.util.Date; 7 | import java.util.HashSet; 8 | import java.util.Set; 9 | 10 | import javax.persistence.CascadeType; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.GeneratedValue; 14 | import javax.persistence.GenerationType; 15 | import javax.persistence.Id; 16 | import javax.persistence.JoinColumn; 17 | import javax.persistence.JoinTable; 18 | import javax.persistence.ManyToMany; 19 | import javax.persistence.Table; 20 | 21 | import net.paoding.analysis.analyzer.PaodingAnalyzer; 22 | 23 | import org.hibernate.annotations.Cache; 24 | import org.hibernate.annotations.CacheConcurrencyStrategy; 25 | import org.hibernate.search.annotations.Analyze; 26 | import org.hibernate.search.annotations.Analyzer; 27 | import org.hibernate.search.annotations.Boost; 28 | import org.hibernate.search.annotations.CacheFromIndex; 29 | import org.hibernate.search.annotations.DateBridge; 30 | import org.hibernate.search.annotations.DocumentId; 31 | import org.hibernate.search.annotations.Field; 32 | import org.hibernate.search.annotations.Index; 33 | import org.hibernate.search.annotations.Indexed; 34 | import org.hibernate.search.annotations.IndexedEmbedded; 35 | import org.hibernate.search.annotations.Resolution; 36 | import org.hibernate.search.annotations.Store; 37 | 38 | @Entity 39 | @Table(catalog="hibernate_search",name="Book") 40 | @Indexed(index="book") 41 | //@Analyzer(impl=IKAnalyzer.class) 42 | @Analyzer(impl=PaodingAnalyzer.class) 43 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Book") 44 | @Boost(2.0f) 45 | @CacheFromIndex( { CLASS, ID } ) 46 | public class Book { 47 | @Id 48 | @GeneratedValue(strategy=GenerationType.AUTO) 49 | @DocumentId 50 | private Integer id; 51 | 52 | @Field(index = Index.YES, analyze = Analyze.YES, store = Store.COMPRESS) 53 | @Boost(1.5f) 54 | private String name; 55 | 56 | @Field(index = Index.YES, analyze = Analyze.YES, store = Store.COMPRESS) 57 | @Boost(1.2f) 58 | private String description; 59 | 60 | @Field(index = Index.YES, analyze = Analyze.NO, store = Store.YES) 61 | @DateBridge(resolution = Resolution.DAY) 62 | private Date publicationDate; 63 | 64 | @IndexedEmbedded(depth=1) 65 | @ManyToMany(cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REFRESH,CascadeType.REMOVE},fetch=FetchType.LAZY) 66 | @JoinTable( 67 | catalog="hibernate_search", 68 | name="Book_Author", 69 | joinColumns={@JoinColumn(name = "book_id")}, 70 | inverseJoinColumns = {@JoinColumn(name = "author_id")} 71 | ) 72 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE,region="org.hibernate.search.hibernate.example.model.Author") 73 | private Set authors = new HashSet(); 74 | 75 | public Integer getId() { 76 | return id; 77 | } 78 | 79 | public void setId(Integer id) { 80 | this.id = id; 81 | } 82 | 83 | public String getName() { 84 | return name; 85 | } 86 | 87 | public void setName(String name) { 88 | this.name = name; 89 | } 90 | 91 | public String getDescription() { 92 | return description; 93 | } 94 | 95 | public void setDescription(String description) { 96 | this.description = description; 97 | } 98 | 99 | public Date getPublicationDate() { 100 | return publicationDate; 101 | } 102 | 103 | public void setPublicationDate(Date publicationDate) { 104 | this.publicationDate = publicationDate; 105 | } 106 | 107 | public Set getAuthors() { 108 | return authors; 109 | } 110 | 111 | public void setAuthors(Set authors) { 112 | this.authors = authors; 113 | } 114 | 115 | public Book() { 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/model/QueryResult.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/model/QueryResult.java -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/service/BookService.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.jpa.example.service; 2 | 3 | import java.util.List; 4 | 5 | import org.apache.lucene.analysis.Analyzer; 6 | import org.hibernate.search.jpa.example.model.Book; 7 | import org.hibernate.search.jpa.example.model.QueryResult; 8 | 9 | public interface BookService { 10 | 11 | void add(Book book); 12 | 13 | Book load(int id); 14 | 15 | List query(int start,int pagesize); 16 | void update(Book book); 17 | void delete(Book book); 18 | void delete(int id); 19 | /** 20 | * 21 | * @param keyword 22 | * @param start 23 | * @param pagesize 24 | * @param analyzer 25 | * @param field 26 | * @return 27 | * @throws Exception 28 | */ 29 | QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer,String...field) throws Exception; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/java/org/hibernate/search/jpa/example/service/impl/BookServiceImpl.java: -------------------------------------------------------------------------------- 1 | package org.hibernate.search.jpa.example.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.annotation.Resource; 6 | 7 | import org.apache.lucene.analysis.Analyzer; 8 | import org.hibernate.search.jpa.example.dao.BookDao; 9 | import org.hibernate.search.jpa.example.model.Book; 10 | import org.hibernate.search.jpa.example.model.QueryResult; 11 | import org.hibernate.search.jpa.example.service.BookService; 12 | import org.springframework.stereotype.Service; 13 | 14 | @Service(value="bookServiceImpl") 15 | public class BookServiceImpl implements BookService { 16 | 17 | @Resource(name="bookDaoImpl") 18 | private BookDao bookDao; 19 | 20 | @Override 21 | public void add(Book book) { 22 | bookDao.add(book); 23 | } 24 | 25 | @Override 26 | public List query(int start, int pagesize) { 27 | return bookDao.query(start, pagesize); 28 | } 29 | 30 | @Override 31 | public void update(Book book) { 32 | bookDao.update(book); 33 | } 34 | 35 | @Override 36 | public void delete(Book book) { 37 | bookDao.delete(book); 38 | } 39 | 40 | @Override 41 | public void delete(int id) { 42 | bookDao.delete(id); 43 | } 44 | 45 | @Override 46 | public QueryResult query(String keyword, int start, int pagesize,Analyzer analyzer, String... field) throws Exception { 47 | return bookDao.query(keyword, start, pagesize, analyzer, field); 48 | } 49 | 50 | @Override 51 | public Book load(int id) { 52 | return bookDao.load(id); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/IKAnalyzer.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IK Analyzer 扩展配置 5 | 8 | 9 | stopword.dic; 10 | 11 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | org.hibernate.ejb.HibernatePersistence 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | true 89 | true 90 | org.hibernate.cache.EhCacheProvider 91 | org.hibernate.cache.ehcache.EhCacheRegionFactory 92 | /ehcache.xml 93 | 94 | org.hibernate.dialect.MySQL5InnoDBDialect 95 | 20 96 | 97 | 98 | LUCENE_36 99 | filesystem 100 | target/lucene/indexes 101 | 102 | 103 | 1000 104 | 100 105 | 106 | 107 | 108 | 109 | 110 | org.hibernate.search.jpa.example.model 111 | 112 | 113 | 114 | 122 | 123 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/administrative.dic: -------------------------------------------------------------------------------- 1 | 人事部 2 | 信息产业部 3 | 农业部 4 | 医管局 5 | 发改委 6 | 国土资源部 7 | 国防部 8 | 外交部 9 | 教育部 10 | 文化部 11 | 民政部 12 | 能源部 13 | 能源部 14 | 财政部 15 | 铁道部 16 | 防卫厅 17 | 防卫省 18 | 革命委员会 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/appellation.dic: -------------------------------------------------------------------------------- 1 | 中队长 2 | 主任 3 | 主席 4 | 军长 5 | 医生 6 | 博士 7 | 厂长 8 | 司令 9 | 大队长 10 | 夫人 11 | 小队长 12 | 局长 13 | 师傅 14 | 师长 15 | 总统 16 | 指导 17 | 排长 18 | 教授 19 | 教练 20 | 旅长 21 | 校长 22 | 班长 23 | 秘书 24 | 组长 25 | 经理 26 | 老师 27 | 营长 28 | 董事 29 | 董事长 30 | 连长 31 | 队长 32 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/company.dic: -------------------------------------------------------------------------------- 1 | 中国中央电视台 2 | 中国电信有限公司 3 | 中国移动通讯有限公司 4 | 中国网通有限公司 5 | 中国联合通讯有限公司 6 | 中国联通 7 | 中央电视台 8 | 北京百度科技发展有限公司 9 | 央视 10 | 电信 11 | 百度 12 | 移动 13 | 网通 14 | 联通 15 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/comupter-science.dic: -------------------------------------------------------------------------------- 1 | 主板 2 | 内存 3 | 键盘 4 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/contemporary-words.dic: -------------------------------------------------------------------------------- 1 | 支付宝 2 | 斑竹 3 | 站长 4 | 贝宝 5 | 陶宝 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/africa.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/africa.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/america.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/america.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/europe.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/europe.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/japan.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/japan.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/korea.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/korea.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/oceania.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/oceania.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/readme.txt: -------------------------------------------------------------------------------- 1 | 地区划分在此记录 2 | 比如中国的省市县,国外的洲、河流等 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/division/taiwan.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/division/taiwan.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/festival.dic: -------------------------------------------------------------------------------- 1 | 七七纪念日 2 | 七夕 3 | 七夕情人节 4 | 七夕节 5 | 万圣节 6 | 世界人权日 7 | 世界儿歌节 8 | 世界儿童节 9 | 世界动物日 10 | 世界卫生日 11 | 世界地球日 12 | 世界教师日 13 | 世界无烟日 14 | 世界无童工日 15 | 世界林业节 16 | 世界森林日 17 | 世界水日 18 | 世界海洋日 19 | 世界湿地日 20 | 世界献血日 21 | 世界环境日 22 | 世界电视日 23 | 世界睡眠日 24 | 世界粮食日 25 | 世界精神卫生日 26 | 世界红十字日 27 | 世界问候日 28 | 中国人民抗日战争纪念日 29 | 中国国耻日 30 | 中国学生营养日 31 | 中国爱牙日 32 | 中国爱耳日 33 | 中国青年志愿者服务日 34 | 中国青年节 35 | 中秋 36 | 中秋节 37 | 人口日 38 | 人权日 39 | 儿歌节 40 | 儿童节 41 | 元宵 42 | 元宵节 43 | 元旦 44 | 党生日 45 | 全国中小学生安全教育日 46 | 全国助残日 47 | 全国爱眼日 48 | 全国爱耳日 49 | 六十亿人口日 50 | 六四纪念日 51 | 冬至 52 | 减轻自然灾害日 53 | 动物日 54 | 助残日 55 | 劳动妇女节 56 | 劳动节 57 | 博物馆日 58 | 卫生日 59 | 和平日 60 | 国庆 61 | 国庆节 62 | 国耻日 63 | 国际儿童节 64 | 国际减轻自然灾害日 65 | 国际劳动妇女节 66 | 国际劳动节 67 | 国际博物馆日 68 | 国际和平日 69 | 国际奥林匹克日 70 | 国际妇女节 71 | 国际容忍日 72 | 国际左撇子日 73 | 国际志愿者日 74 | 国际护士节 75 | 国际无车日 76 | 国际残疾人日 77 | 国际母语日 78 | 国际气象节 79 | 国际消费者权益日 80 | 国际牛奶日 81 | 国际盲人节 82 | 国际禁毒日 83 | 国际老人日 84 | 国际臭氧层保护日 85 | 国际非洲儿童日 86 | 国际音乐日 87 | 国际麻风日 88 | 圣诞节 89 | 地球日 90 | 处暑 91 | 复活节 92 | 夏至 93 | 大寒 94 | 大暑 95 | 大雪 96 | 奥林匹克日 97 | 妇女节 98 | 学生营养日 99 | 安全教育日 100 | 安全日 101 | 容忍日 102 | 寒露 103 | 小寒 104 | 小年 105 | 小暑 106 | 小满 107 | 小雪 108 | 左撇子日 109 | 平安夜 110 | 建党日 111 | 建军节 112 | 志愿人员日 113 | 志愿者日 114 | 情人节 115 | 惊蛰 116 | 愚人节 117 | 感恩节 118 | 扫房日 119 | 抗日战争纪念日 120 | 抗日纪念日 121 | 护士节 122 | 教师日 123 | 教师节 124 | 文化遗产日 125 | 无烟日 126 | 无童工日 127 | 无车日 128 | 春分 129 | 春节 130 | 植树节 131 | 残疾人日 132 | 母亲节 133 | 母语日 134 | 气象节 135 | 水日 136 | 海洋日 137 | 消费者权益日 138 | 清明 139 | 清明节 140 | 湿地日 141 | 爱牙日 142 | 爱眼日 143 | 爱耳日 144 | 父亲节 145 | 牛奶日 146 | 独立日 147 | 献血日 148 | 环境日 149 | 电视日 150 | 白露 151 | 盲人节 152 | 睡眠日 153 | 秋分 154 | 立冬 155 | 立夏 156 | 立春 157 | 立秋 158 | 端午节 159 | 粮食日 160 | 精神卫生日 161 | 红十字日 162 | 老人日 163 | 联合国日 164 | 腊八节 165 | 腊日 166 | 臭氧保护日 167 | 臭氧层保护日 168 | 芒种 169 | 营养日 170 | 谷雨 171 | 重阳 172 | 重阳节 173 | 问候日 174 | 除夕 175 | 雨水 176 | 霜降 177 | 青年志愿者服务日 178 | 青年节 179 | 非洲儿童日 180 | 音乐日 181 | 麻风日 182 | 龙头节 183 | -182 184 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/language.dic: -------------------------------------------------------------------------------- 1 | 中文 2 | 台湾话 3 | 台语 4 | 客家话 5 | 汉字 6 | 汉语 7 | 法文 8 | 法语 9 | 福建话 10 | 粤语 11 | 美语 12 | 英文 13 | 英语 14 | 西班牙语 15 | 闽南语 16 | -15 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/locale/beijing.dic: -------------------------------------------------------------------------------- 1 | 健翔桥 2 | 北医大 3 | 四惠东 4 | 复兴门 5 | 天安门 6 | 德胜门 7 | 德胜门西 8 | 新街口 9 | 朝阳门 10 | 正阳门 11 | 水立方 12 | 积水潭 13 | 积水潭桥 14 | 苹果园 15 | 西直门 16 | 长安街 17 | -15 18 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/locale/quanzhou.dic: -------------------------------------------------------------------------------- 1 | 东西塔 2 | 崇武 3 | 惠安 4 | 洛阳桥 5 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/locale/readme.txt: -------------------------------------------------------------------------------- 1 | 各地方街道等在此录入 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/locale/xiamen.dic: -------------------------------------------------------------------------------- 1 | 思明区 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/name-foreign.dic: -------------------------------------------------------------------------------- 1 | 亚历山大 2 | 克林顿 3 | 克里斯汀 4 | 布什 5 | 布莱尔 6 | 科特勒 7 | 约翰 8 | 约翰逊 9 | 蒂娜 10 | -11 11 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/nation.dic: -------------------------------------------------------------------------------- 1 | 东非 2 | 中华 3 | 中华 4 | 中华人民共和国 5 | 中华民国 6 | 中国 7 | 中国 8 | 中非 9 | 乌克兰 10 | 也门 11 | 以色列 12 | 伊拉克 13 | 伊朗 14 | 俄罗斯 15 | 分类 16 | 加拿大 17 | 南非 18 | 古巴 19 | 台湾 20 | 埃及 21 | 塞尔维亚 22 | 墨西哥 23 | 威尔士 24 | 尼日利亚 25 | 巴比伦 26 | 希腊 27 | 德国 28 | 德意志 29 | 意大利 30 | 捷克 31 | 日本 32 | 朝鲜 33 | 比利时 34 | 法兰西 35 | 法国 36 | 波兰 37 | 波黑 38 | 瑞典 39 | 瑞士 40 | 白俄罗斯 41 | 缅甸 42 | 美利坚 43 | 美利坚合众国 44 | 美国 45 | 老挝 46 | 苏格兰 47 | 苏联 48 | 英国 49 | 英格兰 50 | 葡萄牙 51 | 蒙古 52 | 西班牙 53 | 越南 54 | 韩国 55 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/org-domestic.dic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/dic/org-domestic.dic -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/org-foreign.dic: -------------------------------------------------------------------------------- 1 | 上海合作组织 2 | 世卫 3 | 世界卫生组织 4 | 世界银行 5 | 东盟 6 | 亚太经合组织 7 | 人权理事会 8 | 六方会谈 9 | 北约 10 | 哈马斯 11 | 安全理事会 12 | 安理会 13 | 欧佩克 14 | 红十字会 15 | 联合国 16 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/paoding-dic-names.properties: -------------------------------------------------------------------------------- 1 | #dictionary character encoding 2 | #paoding.dic.charset=UTF-8 3 | 4 | ### Set maximum word length (Chinese character) that analyzer can support. Longer words will be ignored. 5 | ### By default, it is set to "0", which means all words will be analyzed. 6 | #paoding.dic.maxWordLen=0 7 | 8 | #dictionaries which are skip 9 | #paoding.dic.skip.prefix=x- 10 | 11 | #chinese/cjk charactors that will not token 12 | #paoding.dic.noise-charactor=x-noise-charactor 13 | 14 | #chinese/cjk words that will not token 15 | #paoding.dic.noise-word=x-noise-word 16 | 17 | #unit words, like "ge", "zhi", ... 18 | #paoding.dic.unit=x-unit 19 | 20 | #like "Wang", "Zhang", ... 21 | #paoding.dic.confucian-family-name=x-confucian-family-name 22 | 23 | #linke "uPAN", "cdHE" 24 | #paoding.dic.for-combinatorics=x-for-combinatorics 25 | 26 | 27 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/star-domestic.dic: -------------------------------------------------------------------------------- 1 | 丁俊辉 2 | 乾隆 3 | 刘德华 4 | 刘翔 5 | 华仔 6 | 周杰伦 7 | 姚明 8 | 小丁 9 | 小辉 10 | 庖丁 11 | 康熙 12 | 张学友 13 | 朱军 14 | 朱德 15 | 朱德茂 16 | 朱镕基 17 | 李世民 18 | 李瑞环 19 | 武则天 20 | 毛主席 21 | 毛泽东 22 | 江泽民 23 | 老许 24 | 胡志明 25 | 胡锦涛 26 | 许静蕾 27 | 诸葛亮 28 | 赵本山 29 | 陈佩斯 30 | 马云 31 | 马加爵 32 | -30 33 | #历史、政治、学术、企业、娱乐、体育、社会现象 34 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/star-foreign.dic: -------------------------------------------------------------------------------- 1 | 比尔 2 | 盖茨 3 | -2 4 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/x-confucian-family-name.dic: -------------------------------------------------------------------------------- 1 | 丁 2 | 万 3 | 上官 4 | 丘 5 | 东郭 6 | 严 7 | 丰 8 | 乃 9 | 乌 10 | 乐 11 | 乔 12 | 习 13 | 云 14 | 亚 15 | 什 16 | 仇 17 | 仝 18 | 任 19 | 伊 20 | 伍 21 | 伏 22 | 休 23 | 伦 24 | 伯 25 | 何 26 | 佘 27 | 余 28 | 佟 29 | 佩 30 | 侯 31 | 俄 32 | 保 33 | 俞 34 | 倪 35 | 傅 36 | 储 37 | 元 38 | 克 39 | 公孙 40 | 兰 41 | 关 42 | 兹 43 | 内 44 | 冈 45 | 冉 46 | 农 47 | 冯 48 | 况 49 | 冷 50 | 冼 51 | 凌 52 | 凤 53 | 凯 54 | 刀 55 | 刁 56 | 切 57 | 刘 58 | 利 59 | 加 60 | 努 61 | 励 62 | 劳 63 | 勒 64 | 勾 65 | 包 66 | 匡 67 | 匹 68 | 华 69 | 卓 70 | 单 71 | 单于 72 | 博 73 | 卜 74 | 卞 75 | 卡 76 | 卢 77 | 卫 78 | 印 79 | 危 80 | 厄 81 | 厉 82 | 及 83 | 古 84 | 可 85 | 史 86 | 叶 87 | 司徒 88 | 司空 89 | 司马 90 | 合 91 | 吉 92 | 吕 93 | 吴 94 | 周 95 | 哈 96 | 哥 97 | 唐 98 | 商 99 | 喀 100 | 喻 101 | 图 102 | 土 103 | 坦 104 | 埃 105 | 基 106 | 塔 107 | 塞 108 | 墨 109 | 夏 110 | 多 111 | 大 112 | 夫 113 | 奇 114 | 奚 115 | 奥 116 | 姆 117 | 姚 118 | 姜 119 | 姬 120 | 娄 121 | 孔 122 | 孙 123 | 孟 124 | 季 125 | 安 126 | 宋 127 | 宗 128 | 官 129 | 宝 130 | 宣 131 | 宫 132 | 容 133 | 宾 134 | 寿 135 | 封 136 | 尉 137 | 小泉 138 | 尔 139 | 尤 140 | 尹 141 | 尼 142 | 居 143 | 屈 144 | 屠 145 | 岑 146 | 岳 147 | 崔 148 | 左 149 | 巫 150 | 巴 151 | 布 152 | 希 153 | 帕 154 | 常 155 | 平 156 | 幸 157 | 庄 158 | 库 159 | 应 160 | 庞 161 | 康 162 | 廉 163 | 廖 164 | 延 165 | 弗 166 | 张 167 | 强 168 | 彦 169 | 彭 170 | 徐 171 | 德 172 | 慕容 173 | 戈 174 | 成 175 | 戚 176 | 戴 177 | 房 178 | 托 179 | 拉 180 | 招 181 | 摩 182 | 敖 183 | 斐 184 | 斯 185 | 方 186 | 於 187 | 昌 188 | 明 189 | 易 190 | 晋 191 | 晏 192 | 普 193 | 曹 194 | 曼 195 | 曾 196 | 朗 197 | 朱 198 | 朴 199 | 权 200 | 李 201 | 杜 202 | 来 203 | 杨 204 | 杭 205 | 杰 206 | 林 207 | 柏 208 | 查 209 | 柯 210 | 柳 211 | 柴 212 | 根 213 | 格 214 | 桂 215 | 桑 216 | 梁 217 | 梅 218 | 森 219 | 楚 220 | 楼 221 | 樊 222 | 欧阳 223 | 武 224 | 段 225 | 殷 226 | 比 227 | 毕 228 | 毛 229 | 江 230 | 池 231 | 汤 232 | 汪 233 | 沃 234 | 沈 235 | 沙 236 | 法 237 | 波 238 | 泰 239 | 泽 240 | 洛 241 | 洪 242 | 浦 243 | 涂 244 | 淳 245 | 温 246 | 游 247 | 湛 248 | 溥 249 | 滕 250 | 满 251 | 潘 252 | 澳 253 | 澹台 254 | 烈 255 | 焦 256 | 熊 257 | 燕 258 | 爱 259 | 爱新觉罗 260 | 牛 261 | 牟 262 | 特 263 | 狄 264 | 王 265 | 班 266 | 理 267 | 瑞 268 | 瑶 269 | 瓦 270 | 甄 271 | 甘 272 | 田 273 | 申 274 | 登 275 | 白 276 | 皇甫 277 | 皮 278 | 盖 279 | 盛 280 | 瞿 281 | 石 282 | 祁 283 | 祖 284 | 祝 285 | 福 286 | 禹 287 | 禾 288 | 科 289 | 秦 290 | 程 291 | 稽 292 | 穆 293 | 空 294 | 窦 295 | 章 296 | 端 297 | 竺 298 | 简 299 | 管 300 | 米 301 | 索 302 | 累 303 | 纪 304 | 纳 305 | 练 306 | 维 307 | 缪 308 | 罗 309 | 翁 310 | 翟 311 | 翦 312 | 耶 313 | 耿 314 | 聂 315 | 胡 316 | 胥 317 | 腓 318 | 腾 319 | 臧 320 | 舍 321 | 舒 322 | 良 323 | 艾 324 | 芬 325 | 芮 326 | 花 327 | 苏 328 | 苗 329 | 苟 330 | 英 331 | 范 332 | 茅 333 | 茨 334 | 荀 335 | 荆 336 | 荣 337 | 莫 338 | 莱 339 | 萧 340 | 萨 341 | 董 342 | 蒂 343 | 蒋 344 | 蒙 345 | 蒲 346 | 蓝 347 | 蓬 348 | 蔚 349 | 蔡 350 | 薛 351 | 虞 352 | 蚁 353 | 衡 354 | 袁 355 | 裘 356 | 裴 357 | 褚 358 | 西 359 | 解 360 | 言 361 | 詹 362 | 许 363 | 诸 364 | 诸葛 365 | 诺 366 | 谈 367 | 谢 368 | 谭 369 | 谷 370 | 贝 371 | 费 372 | 贺 373 | 贾 374 | 赖 375 | 赛 376 | 赫 377 | 赵 378 | 路 379 | 辛 380 | 辜 381 | 边 382 | 达 383 | 迈 384 | 连 385 | 迟 386 | 迪 387 | 逊 388 | 邓 389 | 邝 390 | 邢 391 | 那 392 | 邬 393 | 邰 394 | 邱 395 | 邵 396 | 邹 397 | 郁 398 | 郎 399 | 郑 400 | 郝 401 | 郭 402 | 都 403 | 里 404 | 金 405 | 钟 406 | 钮 407 | 钱 408 | 银 409 | 闵 410 | 闻 411 | 阎 412 | 阮 413 | 阳 414 | 阿 415 | 陆 416 | 陈 417 | 陶 418 | 隆 419 | 雅 420 | 雷 421 | 霍 422 | 靳 423 | 韦 424 | 韩 425 | 项 426 | 顾 427 | 颜 428 | 饶 429 | 马 430 | 骆 431 | 高 432 | 魏 433 | 鱼 434 | 鲁 435 | 鲍 436 | 鲜 437 | 麦 438 | 麻 439 | 黄 440 | 黎 441 | 黛 442 | 齐 443 | 龙 444 | 龚 445 | -444 446 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/x-for-combinatorics.dic: -------------------------------------------------------------------------------- 1 | U盘 2 | CD盒 3 | CD机 4 | C盘 5 | D盘 6 | E盘 7 | F盘 8 | G盘 9 | H盘 10 | I盘 11 | J盘 12 | K盘 13 | Z盘 14 | K歌之王 15 | A座 16 | B座 17 | C座 18 | D座 19 | E座 20 | F座 21 | A计划 22 | B计划 23 | B超 24 | Q版 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/x-noise-charactor.dic: -------------------------------------------------------------------------------- 1 | 的 2 | 一 3 | 不 4 | 在 5 | 人 6 | 有 7 | 是 8 | 为 9 | 以 10 | 于 11 | 上 12 | 他 13 | 而 14 | 后 15 | 之 16 | 来 17 | 及 18 | 了 19 | 因 20 | 下 21 | 可 22 | 到 23 | 由 24 | 这 25 | 与 26 | 也 27 | 此 28 | 但 29 | 并 30 | 个 31 | 其 32 | 已 33 | 无 34 | 小 35 | 我 36 | 们 37 | 起 38 | 最 39 | 再 40 | 今 41 | 去 42 | 好 43 | 只 44 | 又 45 | 或 46 | 很 47 | 亦 48 | 某 49 | 把 50 | 那 51 | 你 52 | 乃 53 | 它 54 | 吧 55 | 被 56 | 比 57 | 别 58 | 趁 59 | 当 60 | 从 61 | 到 62 | 得 63 | 打 64 | 凡 65 | 儿 66 | 尔 67 | 该 68 | 各 69 | 给 70 | 跟 71 | 和 72 | 何 73 | 还 74 | 即 75 | 几 76 | 既 77 | 看 78 | 据 79 | 距 80 | 靠 81 | 啦 82 | 了 83 | 另 84 | 么 85 | 每 86 | 们 87 | 嘛 88 | 拿 89 | 哪 90 | 那 91 | 您 92 | 凭 93 | 且 94 | 却 95 | 让 96 | 仍 97 | 啥 98 | 如 99 | 若 100 | 使 101 | 谁 102 | 虽 103 | 随 104 | 同 105 | 所 106 | 她 107 | 哇 108 | 嗡 109 | 往 110 | 哪 111 | 些 112 | 向 113 | 沿 114 | 哟 115 | 用 116 | 于 117 | 咱 118 | 则 119 | 怎 120 | 曾 121 | 至 122 | 致 123 | 着 124 | 诸 125 | 自 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/x-noise-word.dic: -------------------------------------------------------------------------------- 1 | 你们 2 | 那样 3 | 所以 4 | 得了 5 | 当地 6 | 有关 7 | 所有 8 | 因之 9 | 用来 10 | 所在 11 | 对待 12 | 而外 13 | 分别 14 | 某些 15 | 对方 16 | 不只 17 | 虽然 18 | 无论 19 | 不论 20 | 无论如何 21 | 但是 22 | 全部 23 | 尽管 24 | 大家 25 | 以便 26 | 自己 27 | 可是 28 | 反之 29 | 这些 30 | 什么 31 | 由此 32 | 万一 33 | 而已 34 | 何以 35 | 咱们 36 | 值此 37 | 向着 38 | 哪怕 39 | 倘若 40 | 出于 41 | 如上 42 | 如若 43 | 替代 44 | 什么样 45 | 如是 46 | 照着 47 | 此处 48 | 这样 49 | 每当 50 | 此次 51 | 至于 52 | 此地 53 | 要不然 54 | 逐步 55 | 格里斯 56 | 本地 57 | 要不 58 | 其次 59 | 尽管如此 60 | 遵循 61 | 乃至 62 | 若是 63 | 并且 64 | 如下 65 | 可以 66 | 才能 67 | 以及 68 | 彼此 69 | 根据 70 | 随后 71 | 有时 72 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dic/x-unit.dic: -------------------------------------------------------------------------------- 1 | 万 2 | 世 3 | 世纪 4 | 两 5 | 个 6 | 中 7 | 乘 8 | 井 9 | 亩 10 | 人 11 | 人工作日 12 | 人日 13 | 人月日 14 | 亿 15 | 仙 16 | 代 17 | 件 18 | 份 19 | 伏 20 | 伏特 21 | 位 22 | 例 23 | 倍 24 | 元 25 | 兆 26 | 光年 27 | 克 28 | 党 29 | 公顷 30 | 册 31 | 出 32 | 分 33 | 分钟 34 | 划 35 | 列 36 | 刻 37 | 剧 38 | 包 39 | 匹 40 | 区 41 | 千 42 | 升 43 | 单 44 | 卫 45 | 卷 46 | 厂 47 | 厅 48 | 厨 49 | 口 50 | 句 51 | 只 52 | 台 53 | 号 54 | 吨 55 | 员 56 | 周 57 | 周岁 58 | 周年 59 | 品 60 | 回 61 | 团 62 | 国 63 | 圆 64 | 圈 65 | 场 66 | 坪 67 | 堆 68 | 堵 69 | 声 70 | 壶 71 | 处 72 | 夜 73 | 大 74 | 天 75 | 头 76 | 女 77 | 孔 78 | 季 79 | 安 80 | 安培 81 | 宗 82 | 室 83 | 家 84 | 寸 85 | 尺 86 | 尾 87 | 局 88 | 层 89 | 届 90 | 岁 91 | 市 92 | 带 93 | 幅 94 | 幕 95 | 平方米 96 | 年 97 | 年级 98 | 床 99 | 店 100 | 度 101 | 座 102 | 弄 103 | 式 104 | 张 105 | 微克 106 | 微秒 107 | 微米 108 | 快 109 | 成 110 | 房 111 | 批 112 | 把 113 | 折 114 | 抽 115 | 捧 116 | 撮 117 | 支 118 | 斤 119 | 族 120 | 日 121 | 时 122 | 晚 123 | 曲 124 | 月 125 | 期 126 | 本 127 | 朵 128 | 束 129 | 条 130 | 杯 131 | 柜 132 | 栋 133 | 样 134 | 根 135 | 桌 136 | 桶 137 | 楼 138 | 次 139 | 步 140 | 段 141 | 毫 142 | 毫克 143 | 毫分 144 | 毫升 145 | 毫秒 146 | 毫米 147 | 洞 148 | 派 149 | 滴 150 | 点 151 | 片 152 | 牛 153 | 环 154 | 班 155 | 瓶 156 | 男 157 | 盏 158 | 盒 159 | 盘 160 | 种 161 | 科 162 | 秒 163 | 秒钟 164 | 立方米 165 | 站 166 | 章 167 | 笔 168 | 等 169 | 箱 170 | 米 171 | 粒 172 | 级 173 | 线 174 | 维 175 | 缸 176 | 群 177 | 翻 178 | 艘 179 | 节 180 | 英寸 181 | 行 182 | 袋 183 | 角 184 | 课 185 | 路 186 | 车 187 | 轮 188 | 辆 189 | 辈 190 | 辑 191 | 道 192 | 部 193 | 里 194 | 重 195 | 针 196 | 钱 197 | 门 198 | 间 199 | 阶 200 | 隔 201 | 集 202 | 面 203 | 页 204 | 颗 205 | 首 206 | -205 207 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/dispatcherServlet-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 17 | 18 | 23 | 24 | 25 | 26 | 28 | 30 | 31 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/hibernate_search.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/main/resources/hibernate_search.sql -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | #log4jdbc# 2 | #url=jdbc:log4jdbc:mysql://localhost:3306/framework 3 | #driverClassName=net.sf.log4jdbc.DriverSpy 4 | 5 | #P6Spy# 6 | #url=jdbc:mysql://localhost:3306/framework 7 | #driverClassName=com.p6spy.engine.spy.P6SpyDriver 8 | 9 | log4jdbc.driverClassName=net.sf.log4jdbc.DriverSpy 10 | P6Spy.driverClassName=com.p6spy.engine.spy.P6SpyDriver 11 | 12 | username=travis 13 | password 14 | 15 | log4jdbc.url=jdbc:log4jdbc:mysql://127.0.0.1:3306/hibernate_search 16 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 8 | 9 | 10 | 11 | 12 | logs/hibernate-search-jpa.log 13 | 14 | logs/hibernate-search-jpa.%d{yyyy-MM-dd}.log 15 | 16 | 17 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/org/hibernate/search/jpa/example/model/Author.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/org/hibernate/search/jpa/example/model/Book.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/paoding-dic-home.properties: -------------------------------------------------------------------------------- 1 | 2 | #values are "system-env" or "this"; 3 | #if value is "this" , using the paoding.dic.home as dicHome if configed! 4 | #paoding.dic.home.config-fisrt=system-env 5 | 6 | #dictionary home (directory) 7 | #"classpath:xxx" means dictionary home is in classpath. 8 | #e.g "classpath:dic" means dictionaries are in "classes/dic" directory or any other classpath directory 9 | paoding.dic.home=classpath:dic 10 | 11 | #seconds for dic modification detection 12 | #paoding.dic.detector.interval=60 13 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/spy.properties: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | # P6Spy Options File # 3 | # See documentation for detailed instructions # 4 | ################################################################# 5 | 6 | ################################################################# 7 | # MODULES # 8 | # # 9 | # Modules provide the P6Spy functionality. If a module, such # 10 | # as module_log is commented out, that functionality will not # 11 | # be available. If it is not commented out (if it is active), # 12 | # the functionality will be active. # 13 | # # 14 | # Values set in Modules cannot be reloaded using the # 15 | # reloadproperties variable. Once they are loaded, they remain # 16 | # in memory until the application is restarted. # 17 | # # 18 | ################################################################# 19 | 20 | module.log=com.p6spy.engine.logging.P6LogFactory 21 | #module.outage=com.p6spy.engine.outage.P6OutageFactory 22 | 23 | ################################################################# 24 | # REALDRIVER(s) # 25 | # # 26 | # In your application server configuration file you replace the # 27 | # "real driver" name with com.p6spy.engine.P6SpyDriver. This is # 28 | # where you put the name of your real driver P6Spy can find and # 29 | # register your real driver to do the database work. # 30 | # # 31 | # If your application uses several drivers specify them in # 32 | # realdriver2, realdriver3. See the documentation for more # 33 | # details. # 34 | # # 35 | # Values set in REALDRIVER(s) cannot be reloaded using the # 36 | # reloadproperties variable. Once they are loaded, they remain # 37 | # in memory until the application is restarted. # 38 | # # 39 | ################################################################# 40 | 41 | # oracle driver 42 | # realdriver=oracle.jdbc.driver.OracleDriver 43 | 44 | # mysql Connector/J driver 45 | # realdriver=com.mysql.jdbc.Driver 46 | 47 | # informix driver 48 | # realdriver=com.informix.jdbc.IfxDriver 49 | 50 | # ibm db2 driver 51 | # realdriver=COM.ibm.db2.jdbc.net.DB2Driver 52 | 53 | # the mysql open source driver 54 | realdriver=com.mysql.jdbc.Driver 55 | 56 | #specifies another driver to use 57 | realdriver2= 58 | #specifies a third driver to use 59 | realdriver3= 60 | 61 | 62 | #the DriverManager class sequentially tries every driver that is 63 | #registered to find the right driver. In some instances, it's possible to 64 | #load up the realdriver before the p6spy driver, in which case your connections 65 | #will not get wrapped as the realdriver will "steal" the connection before 66 | #p6spy sees it. Set the following property to "true" to cause p6spy to 67 | #explicitily deregister the realdrivers 68 | deregisterdrivers=true 69 | 70 | ################################################################ 71 | # P6LOG SPECIFIC PROPERTIES # 72 | ################################################################ 73 | # no properties currently available 74 | 75 | ################################################################ 76 | # EXECUTION THRESHOLD PROPERTIES # 77 | ################################################################ 78 | # This feature applies to the standard logging of P6Spy. # 79 | # While the standard logging logs out every statement # 80 | # regardless of its execution time, this feature puts a time # 81 | # condition on that logging. Only statements that have taken # 82 | # longer than the time specified (in milliseconds) will be # 83 | # logged. This way it is possible to see only statements that # 84 | # have exceeded some high water mark. # 85 | # This time is reloadable. # 86 | # 87 | # executionthreshold=integer time (milliseconds) 88 | # 89 | executionthreshold= 90 | 91 | ################################################################ 92 | # P6OUTAGE SPECIFIC PROPERTIES # 93 | ################################################################ 94 | # Outage Detection 95 | # 96 | # This feature detects long-running statements that may be indicative of 97 | # a database outage problem. If this feature is turned on, it will log any 98 | # statement that surpasses the configurable time boundary during its execution. 99 | # When this feature is enabled, no other statements are logged except the long 100 | # running statements. The interval property is the boundary time set in seconds. 101 | # For example, if this is set to 2, then any statement requiring at least 2 102 | # seconds will be logged. Note that the same statement will continue to be logged 103 | # for as long as it executes. So if the interval is set to 2, and the query takes 104 | # 11 seconds, it will be logged 5 times (at the 2, 4, 6, 8, 10 second intervals). 105 | # 106 | # outagedetection=true|false 107 | # outagedetectioninterval=integer time (seconds) 108 | # 109 | outagedetection=false 110 | outagedetectioninterval= 111 | 112 | ################################################################ 113 | # COMMON PROPERTIES # 114 | ################################################################ 115 | 116 | # filter what is logged 117 | filter=false 118 | 119 | # comma separated list of tables to include when filtering 120 | include = 121 | # comma separated list of tables to exclude when filtering 122 | exclude = 123 | 124 | # sql expression to evaluate if using regex filtering 125 | sqlexpression = 126 | 127 | 128 | # turn on tracing 129 | autoflush = true 130 | 131 | # sets the date format using Java's SimpleDateFormat routine 132 | dateformat= 133 | 134 | #list of categories to explicitly include 135 | includecategories= 136 | 137 | #list of categories to exclude: error, info, batch, debug, statement, 138 | #commit, rollback and result are valid values 139 | excludecategories=info,debug,result,batch 140 | 141 | 142 | #allows you to use a regex engine or your own matching engine to determine 143 | #which statements to log 144 | # 145 | #stringmatcher=com.p6spy.engine.common.GnuRegexMatcher 146 | #stringmatcher=com.p6spy.engine.common.JakartaRegexMatcher 147 | stringmatcher= 148 | 149 | # prints a stack trace for every statement logged 150 | stacktrace=false 151 | # if stacktrace=true, specifies the stack trace to print 152 | stacktraceclass= 153 | 154 | # determines if property file should be reloaded 155 | reloadproperties=false 156 | # determines how often should be reloaded in seconds 157 | reloadpropertiesinterval=60 158 | 159 | #if=true then url must be prefixed with p6spy: 160 | useprefix=false 161 | 162 | #specifies the appender to use for logging 163 | #appender=com.p6spy.engine.logging.appender.Log4jLogger 164 | #appender=com.p6spy.engine.logging.appender.StdoutLogger 165 | appender=com.p6spy.engine.logging.appender.FileLogger 166 | 167 | # name of logfile to use, note Windows users should make sure to use forward slashes in their pathname (e:/test/spy.log) (used for file logger only) 168 | logfile = spy.log 169 | 170 | # append to the p6spy log file. if this is set to false the 171 | # log file is truncated every time. (file logger only) 172 | append=true 173 | 174 | #The following are for log4j logging only 175 | log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender 176 | log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout 177 | log4j.appender.STDOUT.layout.ConversionPattern=p6spy - %m%n 178 | 179 | #log4j.appender.CHAINSAW_CLIENT=org.apache.log4j.net.SocketAppender 180 | #log4j.appender.CHAINSAW_CLIENT.RemoteHost=localhost 181 | #log4j.appender.CHAINSAW_CLIENT.Port=4445 182 | #log4j.appender.CHAINSAW_CLIENT.LocationInfo=true 183 | 184 | log4j.logger.p6spy=INFO,STDOUT 185 | 186 | 187 | ################################################################# 188 | # DataSource replacement # 189 | # # 190 | # Replace the real DataSource class in your application server # 191 | # configuration with the name com.p6spy.engine.spy.P6DataSource,# 192 | # then add the JNDI name and class name of the real # 193 | # DataSource here # 194 | # # 195 | # Values set in this item cannot be reloaded using the # 196 | # reloadproperties variable. Once it is loaded, it remains # 197 | # in memory until the application is restarted. # 198 | # # 199 | ################################################################# 200 | #realdatasource=/RealMySqlDS 201 | #realdatasourceclass=com.mysql.jdbc.jdbc2.optional.MysqlDataSource 202 | 203 | ################################################################# 204 | # DataSource properties # 205 | # # 206 | # If you are using the DataSource support to intercept calls # 207 | # to a DataSource that requires properties for proper setup, # 208 | # define those properties here. Use name value pairs, separate # 209 | # the name and value with a semicolon, and separate the # 210 | # pairs with commas. # 211 | # # 212 | # The example shown here is for mysql # 213 | # # 214 | ################################################################# 215 | #realdatasourceproperties=port;3306,serverName;ibmhost,databaseName;mydb 216 | 217 | 218 | ################################################################# 219 | # JNDI DataSource lookup # 220 | # # 221 | # If you are using the DataSource support outside of an app # 222 | # server, you will probably need to define the JNDI Context # 223 | # environment. # 224 | # # 225 | # If the P6Spy code will be executing inside an app server then # 226 | # do not use these properties, and the DataSource lookup will # 227 | # use the naming context defined by the app server. # 228 | # # 229 | # The two standard elements of the naming environment are # 230 | # jndicontextfactory and jndicontextproviderurl. If you need # 231 | # additional elements, use the jndicontextcustom property. # 232 | # You can define multiple properties in jndicontextcustom, # 233 | # in name value pairs. Separate the name and value with a # 234 | # semicolon, and separate the pairs with commas. # 235 | # # 236 | # The example shown here is for a standalone program running on # 237 | # a machine that is also running JBoss, so the JDNI context # 238 | # is configured for JBoss (3.0.4). # 239 | # # 240 | ################################################################# 241 | #jndicontextfactory=org.jnp.interfaces.NamingContextFactory 242 | #jndicontextproviderurl=localhost:1099 243 | #jndicontextcustom=java.naming.factory.url.pkgs;org.jboss.nameing:org.jnp.interfaces 244 | 245 | #jndicontextfactory=com.ibm.websphere.naming.WsnInitialContextFactory 246 | #jndicontextproviderurl=iiop://localhost:900 -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/resources/stopword.dic: -------------------------------------------------------------------------------- 1 | a 2 | an 3 | and 4 | are 5 | as 6 | at 7 | be 8 | but 9 | by 10 | for 11 | if 12 | in 13 | into 14 | is 15 | it 16 | no 17 | not 18 | of 19 | on 20 | or 21 | such 22 | that 23 | the 24 | their 25 | then 26 | there 27 | these 28 | they 29 | this 30 | to 31 | was 32 | will 33 | with -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/webapp/WEB-INF/views/error/401.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> 3 | 4 | 5 | 6 | Access Denied 7 | 15 | 16 | 17 |
18 |

Access Denied

19 |
20 |

访问被拒绝

21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/webapp/WEB-INF/views/error/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | <%response.setStatus(200);%> 5 | 6 | 7 | 8 | 9 | 404 - 页面不存在 10 | 15 | 16 | 17 | 18 |
19 |

404公益页面

20 | 21 |

">返回首页

22 |
23 | 24 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/webapp/WEB-INF/views/error/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ page import="org.slf4j.Logger,org.slf4j.LoggerFactory" %> 4 | <%response.setStatus(200);%> 5 | 6 | <% 7 | Throwable ex = null; 8 | if (exception != null) 9 | ex = exception; 10 | if (request.getAttribute("javax.servlet.error.exception") != null) 11 | ex = (Throwable) request.getAttribute("javax.servlet.error.exception"); 12 | 13 | //记录日志 14 | Logger logger = LoggerFactory.getLogger("500.jsp"); 15 | logger.error(ex.getMessage(), ex); 16 | %> 17 | 18 | 19 | 20 | 21 | 500 - 系统内部错误 22 | 23 | 24 | 25 |

500 - 系统发生内部错误.

26 |

">返回首页

27 | 28 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/webapp/WEB-INF/views/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | 4 | 5 | 6 | 7 | Hibernate Search Example 8 | 9 | 39 | 40 | 41 |

Spring3.2+Hibernate4.2+Hibernate Search4.2整合(IKAnalyzer、paoding)实现中文分词索引实时同步

42 |
43 | 搜索: 44 |
45 | 46 | 47 | 48 | 49 |
50 |
51 |
52 | 新增: 53 |
54 | 书名:
55 | 作者:
56 | 作者:
57 | 描述:
58 | 59 |
60 |
61 | 修改: 62 |
63 | 64 | 书名:
65 | 作者:
66 | 作者:
67 | 描述:
68 | 69 |
70 | 71 |
72 | 73 | 共查到[${queryResult.searchresultsize}]处结果!
74 | 75 | 编号 :
76 | 书名 :
77 | 作者 : 78 | 79 |   80 |
81 | 描述 :
82 | 出版日期 :
83 | 删除 84 | 修改 85 |
86 |
87 |
88 | 89 | 没有要查询的内容! 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | hibernate-search-jpa 4 | 5 | 6 | org.springframework.web.context.ContextLoaderListener 7 | 8 | 9 | 10 | org.springframework.web.util.IntrospectorCleanupListener 11 | 12 | 13 | 14 | contextConfigLocation 15 | classpath:applicationContext.xml 16 | 17 | 18 | 19 | 20 | encodingFilter 21 | org.springframework.web.filter.CharacterEncodingFilter 22 | 23 | encoding 24 | UTF-8 25 | 26 | 27 | forceEncoding 28 | true 29 | 30 | 31 | 32 | encodingFilter 33 | /* 34 | 35 | 36 | 37 | 38 | 39 | 40 | openEntityManagerInViewFilter 41 | org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter 42 | 43 | entityManagerFactoryBeanName 44 | entityManagerFactory 45 | 46 | 47 | 48 | openEntityManagerInViewFilter 49 | /* 50 | 51 | 52 | 53 | DruidWebStatFilter 54 | com.alibaba.druid.support.http.WebStatFilter 55 | 56 | exclusions 57 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 58 | 59 | 60 | sessionStatMaxCount 61 | 1000 62 | 63 | 64 | sessionStatEnable 65 | true 66 | 67 | 68 | profileEnable 69 | true 70 | 71 | 72 | 73 | DruidWebStatFilter 74 | /* 75 | 76 | 77 | 78 | 79 | 80 | DruidStatView 81 | com.alibaba.druid.support.http.StatViewServlet 82 | 83 | 84 | DruidStatView 85 | /druid/* 86 | 87 | 88 | 89 | 90 | 91 | dispatcherServlet 92 | org.springframework.web.servlet.DispatcherServlet 93 | 94 | contextConfigLocation 95 | classpath:dispatcherServlet-servlet.xml 96 | 97 | 1 98 | 99 | 100 | 101 | dispatcherServlet 102 | / 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 401 111 | /WEB-INF/views/error/401.jsp 112 | 113 | 114 | 115 | 404 116 | /WEB-INF/views/error/404.jsp 117 | 118 | 119 | 120 | 500 121 | /WEB-INF/views/error/500.jsp 122 | 123 | 124 | 125 | 30 126 | 127 | 128 | 133 | -------------------------------------------------------------------------------- /hibernate-search-jpa/src/test/java/org/hibernate/search/jpa/example/dao/impl/BookDaoImplTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate-search-jpa/src/test/java/org/hibernate/search/jpa/example/dao/impl/BookDaoImplTest.java -------------------------------------------------------------------------------- /hibernate_search_reference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/v5tech/hibernate-search-example/35be8d9f272c6b951d7e8231a14ece9c7a835419/hibernate_search_reference.pdf --------------------------------------------------------------------------------