简体   繁体   English

休眠搜索(存储和索引)

[英]Hibernate Search (Store and Index)

What is the intension of index = Index.YES and store = Store.YES on @Field. @Field上index = Index.YES和store = Store.YES的含义是什么。 At the end (when a search is executed) would this data be loaded from the database (search over the index and load results from database)? 最后(执行搜索时)是否将从数据库中加载此数据(搜索索引并从数据库中加载结果)? Why should I store the data in index too? 为什么还要将数据存储在索引中?

Or is my understanding wrong? 还是我的理解错了?

store : describe whether or not the property is stored in the Lucene index. store:描述该属性是否存储在Lucene索引中。 You can store the value Store.YES (consuming more space in the index but allowing projection, see Section 6.1.2.5, “Projection” for more information), store it in a compressed way Store.COMPRESS (this does consume more CPU), or avoid any storage Store.NO (this is the default value). 您可以存储值Store.YES(在索引中占用更多空间,但允许投影,请参见第6.1.2.5节“投影”以获取更多信息),以压缩方式存储它Store.COMPRESS(这会消耗更多CPU),或避免使用任何存储Store.NO(这是默认值)。 When a property is stored, you can retrieve it from the Lucene Document (note that this is not related to whether the element is indexed or not). 存储属性后,可以从Lucene文档中检索它(请注意,这与是否为元素建立索引无关)。

index: describe how the element is indexed (ie the process used to index the property and the type of information store). 索引:描述如何对元素建立索引(即用于索引属性和信息存储类型的过程)。 The different values are Index.NO (no indexing, ie cannot be found by a query), Index.TOKENIZED (use an analyzer to process the property), Index.UN_TOKENISED (no analyzer pre-processing), Index.NO_NORM (do not store the normalization data). 不同的值是Index.NO(无索引,即无法通过查询找到),Index.TOKENIZED(使用分析器处理属性),Index.UN_TOKENISED(无分析器预处理),Index.NO_NORM(不存储规范化数据)。 The default value is TOKENIZED. 默认值为TOKENIZED。

According: http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.2/html/Hibernate_Search_Reference_Guide/Hibernate_Search-Mapping.html 根据: http : //docs.redhat.com/docs/zh-CN/JBoss_Enterprise_Application_Platform/4.2/html/Hibernate_Search_Reference_Guide/Hibernate_Search-Mapping.html

I think the documentation is quite clear - http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#basic-mapping 我认为文档非常清晰-http://docs.jboss.org/hibernate/search/4.1/reference/zh-CN/html_single/#basic-mapping

Other than that storing the index data in the Lucene index is required if you want to use the projection feature. 如果要使用投影功能,则除了将索引数据存储在Lucene索引中外,还需要其他方法。 Again, this is explained in the documentation. 同样,在文档中对此进行了说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM