Reputation: 23913
What is the intension of index = Index.YES and store = Store.YES on @Field. 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?
Upvotes: 4
Views: 3891
Reputation: 19129
I think the documentation is quite clear - http://docs.jboss.org/hibernate/search/4.1/reference/en-US/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. Again, this is explained in the documentation.
Upvotes: 0
Reputation: 23913
store : describe whether or not the property is stored in the Lucene index. 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). 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).
index: describe how the element is indexed (i.e. the process used to index the property and the type of information store). The different values are Index.NO (no indexing, i.e. 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). The default value is TOKENIZED.
Upvotes: 7