You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2017/10/18 20:40:00 UTC

[geode] branch develop updated: Parameterizing LuceneSerializer with a type

This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 10c3111  Parameterizing LuceneSerializer with a type
10c3111 is described below

commit 10c311157be1c093c5e4bfb29e1e66522c5a3b5c
Author: Dan Smith <up...@apache.org>
AuthorDate: Tue Oct 17 10:59:46 2017 -0700

    Parameterizing LuceneSerializer with a type
    
    User's may want to create LuceneSerializers that only support specific
    types, eg LuceneSerializer<MyDomainObject>. Adding a parameterized type
    to the LuceneSerializer interface.
---
 .../java/org/apache/geode/cache/lucene/LuceneSerializer.java  | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/LuceneSerializer.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/LuceneSerializer.java
index ceebc65..2101b70 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/LuceneSerializer.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/LuceneSerializer.java
@@ -19,20 +19,27 @@ import java.util.Collection;
 
 import org.apache.geode.cache.Declarable;
 import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
 
 import org.apache.geode.annotations.Experimental;
 
 /**
  * An interface for writing the fields of an object into a lucene document
+ * 
+ * @param <T> The type of object supported by this lucene serializer
  */
 @Experimental
-public interface LuceneSerializer extends Declarable {
+public interface LuceneSerializer<T> extends Declarable {
 
   /**
    * Add the fields of the given value to a set of documents
+   *
+   * Added fields should be marked with {@link Field.Store#NO}. These fields are only used for
+   * searches. When doing a query, geode will return the value from the region, not any fields that
+   * are stored on the returned Documents.
    * 
    * @param index lucene index
    * @param value user object to be serialized into index
    */
-  Collection<Document> toDocuments(LuceneIndex index, Object value);
+  Collection<Document> toDocuments(LuceneIndex index, T value);
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].