我是hibernate framework.To的新手,在我的项目中增加搜索的性能--我想为一些表做索引--根据我的研究,hibernate在通过criteria.so执行crud操作时自动索引是它们在hibernate中更快地调优我的搜索的任何方法,并且在外部创建索引也可以提高我的搜索性能?
任何想法都将不胜感激!
发布于 2014-12-02 05:12:25
URL:
http://hibernate.org/search/documentation/getting-started/#define-which-entities-need-to-be-indexed
可以向您提供关于索引n hibernate的详细信息。
下面是链接中的一些片段。有关弗特阅读,请参考链接。
注释@Indexed标记Book是一个实体,需要通过Hibernate搜索进行索引。
package example;
...
@Entity
@Indexed
public class Book {
@Id
@GeneratedValue
private Integer id;
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String title;
@Field(index=Index.YES, analyze=Analyze.YES, store=Store.NO)
private String subtitle;
@Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES)
@DateBridge(resolution=Resolution.DAY)
private Date publicationDate;
@IndexedEmbedded
@ManyToMany
private Set<Author> authors = new HashSet<Author>();
public Book() {
}
// standard getters/setters follow here
...
}https://stackoverflow.com/questions/27242076
复制相似问题