Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixed LuceneSerializer xml configuration

...

Code Block
public LuceneIndexFactory {
 /**
 * Configure the way objects are converted to lucene documents for this lucene index
 * @param luceneSerializer A callback which converts a region value to a 
 * Lucene document or documents to be stored in the index.
 */
 public LuceneIndexFactory setLuceneSerializer(LuceneSerializer luceneSerializer);
}  
  
/**
 * An interface for writing the fields of an object into a lucene document
 * The region key will be added as a field to the returned documents.
 */
public interface LuceneSerializer {
  Collection<Document> toDocuments(Object value);
}

XML Configuration 

 

<cache
    xmlns    xmlns    xmlns    xsi
    xsi:schemaLocation="http://geode.apache.org/schema/cache
        http
        http://geode.apache.org/schema/cache/cache-1.0.xsd
        http
        http://geode.apache.org/schema/lucene
        http
        http://geode.apache.org/schema/lucene/lucene-1.0.xsd"
    version
    version="1.0">
 
    <region
    <region name="region"
 refid
 refid="PARTITION">
        <lucene
        <lucene:index name="index">
           <lucene:field name="a"
 analyzer
 analyzer="org.apache.lucene.analysis.core.KeywordAnalyzer"/>
           <lucene:field name="b"
 analyzer
 analyzer="org.apache.lucene.analysis.core.SimpleAnalyzer"/>
           <lucene:field name="c"
 analyzer
 analyzer="org.apache.lucene.analysis.standard.ClassicAnalyzer"/>
          
<lucene:
serializer
serializer>
<class-name>org
="org
.apache.geode.cache.lucene.
internal.repository.FlatFormatSerializer"
test.MySerializer</class-name>
</lucene:serializer>
      
/>        
</lucene:index>
    <
    </
region>
region>
</
cache>
If serializer is not specified, it will use the default HeterogeneousLuceneSerializer.
 
cache>




  • We will provide a built-in implementation for LuceneSerializer. Use fieldnameAtLevel1.fieldnameAtLevel2 to specify a field in the nested object both for indexing and querying. 

...