geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject [geode] 01/02: GEODE-3242, GEODE-3243: Add gfsh support for LuceneSerializer
Date Wed, 04 Oct 2017 17:28:22 GMT
This is an automated email from the ASF dual-hosted git repository.

upthewaterspout pushed a commit to branch feature/GEODE-3239
in repository https://gitbox.apache.org/repos/asf/geode.git

commit ef7c2d973399af609fd3d70176ba79ec9b5fd0fb
Author: Dan Smith <upthewaterspout@apache.org>
AuthorDate: Mon Oct 2 15:19:29 2017 -0700

    GEODE-3242, GEODE-3243: Add gfsh support for LuceneSerializer
    
    gfsh create index now supports a LuceneSerializer and the serializer is
    persisted in cluster configuration.
---
 .../lucene/internal/cli/LuceneCliStrings.java      | 16 ++------
 .../lucene/internal/cli/LuceneIndexCommands.java   |  6 ++-
 .../cache/lucene/internal/cli/LuceneIndexInfo.java | 10 ++++-
 .../cli/functions/LuceneCreateIndexFunction.java   | 17 +++++++++
 .../internal/cli/LuceneIndexCommandsDUnitTest.java | 27 ++++++++++++++
 .../internal/cli/LuceneIndexCommandsJUnitTest.java |  5 ++-
 .../LuceneCreateIndexFunctionJUnitTest.java        | 31 +++++++++++++++-
 .../LuceneClusterConfigurationDUnitTest.java       | 43 +++++++++++++++++++++-
 8 files changed, 134 insertions(+), 21 deletions(-)

diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneCliStrings.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneCliStrings.java
index 8104b3f..d70c096 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneCliStrings.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneCliStrings.java
@@ -44,16 +44,9 @@ public class LuceneCliStrings {
   public static final String LUCENE_CREATE_INDEX__ANALYZER = "analyzer";
   public static final String LUCENE_CREATE_INDEX__ANALYZER_HELP =
       "Type of the analyzer for each field.\nUse the case sensitive keyword DEFAULT or leave
an analyzer blank to use the default standard analyzer.";
-  public static final String CREATE_INDEX__SUCCESS__MSG =
-      "Index successfully created with following details";
-  public static final String CREATE_INDEX__FAILURE__MSG =
-      "Failed to create index \"{0}\" due to following reasons";
-  public static final String CREATE_INDEX__NAME__MSG = "Name       : {0}";
-  public static final String CREATE_INDEX__REGIONPATH__MSG = "RegionPath : {0}";
-  public static final String CREATE_INDEX__MEMBER__MSG = "Members which contain the index";
-  public static final String CREATE_INDEX__NUMBER__AND__MEMBER = "{0}. {1}";
-  public static final String CREATE_INDEX__EXCEPTION__OCCURRED__ON =
-      "Occurred on following members";
+  public static final String LUCENE_CREATE_INDEX__SERIALIZER = "serializer";
+  public static final String LUCENE_CREATE_INDEX__SERIALIZER_HELP =
+      "Fully qualified class name of the LuceneSerializer to use with this index.\n";
 
   // Describe lucene index commands
   public static final String LUCENE_DESCRIBE_INDEX = "describe lucene index";
@@ -84,9 +77,6 @@ public class LuceneCliStrings {
   public static final String LUCENE_SEARCH_INDEX__DEFAULT_FIELD__HELP =
       "Default field to search in";
   public static final String LUCENE_SEARCH_INDEX__NO_RESULTS_MESSAGE = "No results";
-  public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE = "pageSize";
-  public static final String LUCENE_SEARCH_INDEX__PAGE_SIZE__HELP =
-      "Number of results to be returned in a page";
   public static final String LUCENE_SEARCH_INDEX__KEYSONLY = "keys-only";
   public static final String LUCENE_SEARCH_INDEX__KEYSONLY__HELP =
       "Return only keys of search results.";
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
index 41c8923..77c4535 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
@@ -181,7 +181,9 @@ public class LuceneIndexCommands implements GfshCommand {
           help = LuceneCliStrings.LUCENE_CREATE_INDEX__FIELD_HELP) final String[] fields,
 
       @CliOption(key = LuceneCliStrings.LUCENE_CREATE_INDEX__ANALYZER,
-          help = LuceneCliStrings.LUCENE_CREATE_INDEX__ANALYZER_HELP) final String[] analyzers)
{
+          help = LuceneCliStrings.LUCENE_CREATE_INDEX__ANALYZER_HELP) final String[] analyzers,
+      @CliOption(key = LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER,
+          help = LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER_HELP) final String serializer)
{
 
     Result result;
     XmlEntity xmlEntity = null;
@@ -195,7 +197,7 @@ public class LuceneIndexCommands implements GfshCommand {
       // trim fields for any leading trailing spaces.
       String[] trimmedFields = Arrays.stream(fields).map(String::trim).toArray(String[]::new);
       LuceneIndexInfo indexInfo =
-          new LuceneIndexInfo(indexName, regionPath, trimmedFields, analyzers);
+          new LuceneIndexInfo(indexName, regionPath, trimmedFields, analyzers, serializer);
 
       final ResultCollector<?, ?> rc =
           this.executeFunctionOnAllMembers(createIndexFunction, indexInfo);
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexInfo.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexInfo.java
index ad59f0f..70377e7 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexInfo.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexInfo.java
@@ -19,16 +19,18 @@ public class LuceneIndexInfo extends LuceneFunctionSerializable {
 
   private final String[] searchableFieldNames;
   private final String[] fieldAnalyzers;
+  private final String serializer;
 
   public LuceneIndexInfo(final String indexName, final String regionPath,
-      final String[] searchableFieldNames, String[] fieldAnalyzers) {
+      final String[] searchableFieldNames, String[] fieldAnalyzers, String serializer) {
     super(indexName, regionPath);
     this.searchableFieldNames = searchableFieldNames;
     this.fieldAnalyzers = fieldAnalyzers;
+    this.serializer = serializer;
   }
 
   public LuceneIndexInfo(final String indexName, final String regionPath) {
-    this(indexName, regionPath, null, null);
+    this(indexName, regionPath, null, null, null);
   }
 
   public String[] getSearchableFieldNames() {
@@ -38,4 +40,8 @@ public class LuceneIndexInfo extends LuceneFunctionSerializable {
   public String[] getFieldAnalyzers() {
     return fieldAnalyzers;
   }
+
+  public String getSerializer() {
+    return serializer;
+  }
 }
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
index 65cc361..379c7b3 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunction.java
@@ -27,6 +27,7 @@ import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.lucene.LuceneIndexFactory;
+import org.apache.geode.cache.lucene.LuceneSerializer;
 import org.apache.geode.cache.lucene.LuceneService;
 import org.apache.geode.cache.lucene.LuceneServiceProvider;
 import org.apache.geode.cache.lucene.internal.cli.LuceneCliStrings;
@@ -73,6 +74,7 @@ public class LuceneCreateIndexFunction extends FunctionAdapter implements
Intern
 
       String[] fields = indexInfo.getSearchableFieldNames();
       String[] analyzerName = indexInfo.getFieldAnalyzers();
+      String serializerName = indexInfo.getSerializer();
 
       final LuceneIndexFactory indexFactory = service.createIndexFactory();
       if (analyzerName == null || analyzerName.length == 0) {
@@ -88,6 +90,10 @@ public class LuceneCreateIndexFunction extends FunctionAdapter implements
Intern
         }
       }
 
+      if (serializerName != null && !serializerName.equals("")) {
+        indexFactory.setLuceneSerializer(toSerializer(serializerName));
+      }
+
       REGION_PATH.validateName(indexInfo.getRegionPath());
 
       indexFactory.create(indexInfo.getIndexName(), indexInfo.getRegionPath());
@@ -102,6 +108,17 @@ public class LuceneCreateIndexFunction extends FunctionAdapter implements
Intern
     }
   }
 
+  private LuceneSerializer toSerializer(String serializerName)
+      throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+    String trimmedName = StringUtils.trim(serializerName);
+    if (trimmedName == "") {
+      return null;
+    }
+    Class<? extends LuceneSerializer> clazz =
+        CliUtil.forName(serializerName, LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER);
+    return CliUtil.newInstance(clazz, LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER);
+  }
+
   private Analyzer toAnalyzer(String className) {
     if (className == null)
       className = StandardAnalyzer.class.getCanonicalName();
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
index c73952d..eb491df 100755
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
@@ -20,6 +20,7 @@ import static org.apache.geode.test.dunit.Assert.assertArrayEquals;
 import static org.apache.geode.test.dunit.Assert.assertEquals;
 import static org.apache.geode.test.dunit.Assert.assertFalse;
 import static org.apache.geode.test.dunit.Assert.assertTrue;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -51,6 +52,7 @@ import org.apache.geode.cache.lucene.LuceneServiceProvider;
 import org.apache.geode.cache.lucene.internal.LuceneIndexCreationProfile;
 import org.apache.geode.cache.lucene.internal.LuceneIndexImpl;
 import org.apache.geode.cache.lucene.internal.LuceneServiceImpl;
+import org.apache.geode.cache.lucene.internal.repository.serializer.PrimitiveSerializer;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.management.cli.Result.Status;
 import org.apache.geode.management.internal.cli.commands.CliCommandTestBase;
@@ -58,6 +60,7 @@ import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.result.CommandResult;
 import org.apache.geode.management.internal.cli.result.TabularResultData;
 import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import org.apache.geode.pdx.PdxSerializer;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.junit.categories.DistributedTest;
@@ -199,6 +202,30 @@ public class LuceneIndexCommandsDUnitTest extends CliCommandTestBase
{
   }
 
   @Test
+  public void createIndexWithALuceneSerializerShouldCreateANewIndex() throws Exception {
+    final VM vm1 = Host.getHost(0).getVM(1);
+    vm1.invoke(() -> {
+      getCache();
+    });
+
+    CommandStringBuilder csb = new CommandStringBuilder(LuceneCliStrings.LUCENE_CREATE_INDEX);
+    csb.addOption(LuceneCliStrings.LUCENE__INDEX_NAME, INDEX_NAME);
+    csb.addOption(LuceneCliStrings.LUCENE__REGION_PATH, REGION_NAME);
+    csb.addOption(LuceneCliStrings.LUCENE_CREATE_INDEX__FIELD, "field1,field2,field3");
+    csb.addOption(LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER,
+        PrimitiveSerializer.class.getCanonicalName());
+
+    String resultAsString = executeCommandAndLogResult(csb);
+
+    vm1.invoke(() -> {
+      LuceneService luceneService = LuceneServiceProvider.get(getCache());
+      createRegion();
+      final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
+      assertThat(index.getLuceneSerializer()).isInstanceOf(PrimitiveSerializer.class);
+    });
+  }
+
+  @Test
   public void createIndexShouldNotAcceptBadIndexOrRegionNames() {
     final VM vm1 = Host.getHost(0).getVM(-1);
     vm1.invoke(() -> {
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index 7d52980..6c95e9c 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -56,6 +56,7 @@ import org.apache.geode.cache.lucene.internal.cli.functions.LuceneCreateIndexFun
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneDescribeIndexFunction;
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneDestroyIndexFunction;
 import org.apache.geode.cache.lucene.internal.cli.functions.LuceneListIndexFunction;
+import org.apache.geode.cache.lucene.internal.repository.serializer.PrimitiveSerializer;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
@@ -212,8 +213,10 @@ public class LuceneIndexCommandsJUnitTest {
     String[] fieldAnalyzers = {StandardAnalyzer.class.getCanonicalName(),
         KeywordAnalyzer.class.getCanonicalName(), StandardAnalyzer.class.getCanonicalName()};
 
+    String serializer = PrimitiveSerializer.class.getCanonicalName();
+
     CommandResult result = (CommandResult) commands.createIndex(indexName, regionPath,
-        searchableFields, fieldAnalyzers);
+        searchableFields, fieldAnalyzers, serializer);
     assertEquals(Status.OK, result.getStatus());
     TabularResultData data = (TabularResultData) result.getResultData();
     assertEquals(Arrays.asList("member1", "member2", "member3"), data.retrieveAllValues("Member"));
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunctionJUnitTest.java
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunctionJUnitTest.java
index 5f062d9..09872d5 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunctionJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/functions/LuceneCreateIndexFunctionJUnitTest.java
@@ -33,6 +33,7 @@ import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.cache.execute.ResultSender;
 import org.apache.geode.cache.lucene.internal.InternalLuceneService;
 import org.apache.geode.cache.lucene.internal.cli.LuceneIndexInfo;
+import org.apache.geode.cache.lucene.internal.repository.serializer.PrimitiveSerializer;
 import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
@@ -80,7 +81,7 @@ public class LuceneCreateIndexFunctionJUnitTest {
     String[] analyzers = new String[3];
     analyzerNames.toArray(analyzers);
     LuceneIndexInfo indexInfo = new LuceneIndexInfo("index1", "/region1",
-        new String[] {"field1", "field2", "field3"}, analyzers);
+        new String[] {"field1", "field2", "field3"}, analyzers, null);
     when(context.getArguments()).thenReturn(indexInfo);
 
     LuceneCreateIndexFunction function = new LuceneCreateIndexFunction();
@@ -106,7 +107,7 @@ public class LuceneCreateIndexFunctionJUnitTest {
   @SuppressWarnings("unchecked")
   public void testExecuteWithoutAnalyzer() throws Throwable {
     String fields[] = new String[] {"field1", "field2", "field3"};
-    LuceneIndexInfo indexInfo = new LuceneIndexInfo("index1", "/region1", fields, null);
+    LuceneIndexInfo indexInfo = new LuceneIndexInfo("index1", "/region1", fields, null, null);
     when(context.getArguments()).thenReturn(indexInfo);
 
     LuceneCreateIndexFunction function = new LuceneCreateIndexFunction();
@@ -125,4 +126,30 @@ public class LuceneCreateIndexFunctionJUnitTest {
 
     assertEquals(expectedResult, result);
   }
+
+  @Test
+  @SuppressWarnings("unchecked")
+  public void testExecuteWithSerializer() throws Throwable {
+    String fields[] = new String[] {"field1", "field2", "field3"};
+    LuceneIndexInfo indexInfo = new LuceneIndexInfo("index1", "/region1", fields, null,
+        PrimitiveSerializer.class.getCanonicalName());
+    when(context.getArguments()).thenReturn(indexInfo);
+
+    LuceneCreateIndexFunction function = new LuceneCreateIndexFunction();
+    function = spy(function);
+    doReturn(cache).when(function).getCache();
+    function.execute(context);
+
+    verify(factory).addField(eq("field1"));
+    verify(factory).addField(eq("field2"));
+    verify(factory).addField(eq("field3"));
+    verify(factory).setLuceneSerializer(isA(PrimitiveSerializer.class));
+    verify(factory).create(eq("index1"), eq("/region1"));
+
+    ArgumentCaptor<Set> resultCaptor = ArgumentCaptor.forClass(Set.class);
+    verify(resultSender).lastResult(resultCaptor.capture());
+    CliFunctionResult result = (CliFunctionResult) resultCaptor.getValue();
+
+    assertEquals(expectedResult, result);
+  }
 }
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/configuration/LuceneClusterConfigurationDUnitTest.java
b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/configuration/LuceneClusterConfigurationDUnitTest.java
index f297b78..fb6fa99 100755
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/configuration/LuceneClusterConfigurationDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/configuration/LuceneClusterConfigurationDUnitTest.java
@@ -17,6 +17,7 @@ package org.apache.geode.cache.lucene.internal.configuration;
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.INDEX_NAME;
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.REGION_NAME;
 import static org.apache.geode.distributed.ConfigurationProperties.GROUPS;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -39,6 +40,7 @@ import org.apache.geode.cache.lucene.LuceneIndex;
 import org.apache.geode.cache.lucene.LuceneService;
 import org.apache.geode.cache.lucene.LuceneServiceProvider;
 import org.apache.geode.cache.lucene.internal.cli.LuceneCliStrings;
+import org.apache.geode.cache.lucene.internal.repository.serializer.PrimitiveSerializer;
 import org.apache.geode.cache.lucene.internal.xml.LuceneXmlConstants;
 import org.apache.geode.distributed.internal.ClusterConfigurationService;
 import org.apache.geode.distributed.internal.InternalLocator;
@@ -104,7 +106,6 @@ public class LuceneClusterConfigurationDUnitTest {
     gfshConnector.connectAndVerify(locator);
 
     // Create lucene index.
-    // createLuceneIndexUsingGfsh();
     createLuceneIndexWithAnalyzerUsingGfsh(false);
 
     createRegionUsingGfsh(REGION_NAME, RegionShortcut.PARTITION, null);
@@ -129,6 +130,33 @@ public class LuceneClusterConfigurationDUnitTest {
   }
 
   @Test
+  public void indexWithSerializerGetsCreatedUsingClusterConfiguration() throws Exception
{
+    startNodeUsingClusterConfiguration(1);
+
+    // Connect Gfsh to locator.
+    gfshConnector.connectAndVerify(locator);
+
+    // Create lucene index.
+    createLuceneIndexWithSerializerUsingGfsh(false);
+
+    createRegionUsingGfsh(REGION_NAME, RegionShortcut.PARTITION, null);
+
+    // Start vm2. This should have lucene index created using cluster
+    // configuration.
+    MemberVM vm2 = startNodeUsingClusterConfiguration(2);
+    vm2.invoke(() -> {
+      LuceneService luceneService =
+          LuceneServiceProvider.get(LocatorServerStartupRule.serverStarter.getCache());
+      final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
+      assertNotNull(index);
+      String[] fields = new String[] {"field1", "field2", "field3"};
+      validateIndexFields(fields, index);
+      // Add this check back when we complete xml generation for analyzer.
+      assertThat(index.getLuceneSerializer()).isInstanceOf(PrimitiveSerializer.class);
+    });
+  }
+
+  @Test
   public void verifyClusterConfigurationAfterDestroyIndex() throws Exception {
     Member vm1 = startNodeUsingClusterConfiguration(1);
 
@@ -279,6 +307,19 @@ public class LuceneClusterConfigurationDUnitTest {
     gfshConnector.executeAndVerifyCommand(csb.toString());
   }
 
+  private void createLuceneIndexWithSerializerUsingGfsh(boolean addGroup) throws Exception
{
+    // Gfsh command to create lucene index.
+    CommandStringBuilder csb = new CommandStringBuilder(LuceneCliStrings.LUCENE_CREATE_INDEX);
+    csb.addOption(LuceneCliStrings.LUCENE__INDEX_NAME, INDEX_NAME);
+    csb.addOption(LuceneCliStrings.LUCENE__REGION_PATH, REGION_NAME);
+    csb.addOption(LuceneCliStrings.LUCENE_CREATE_INDEX__FIELD, "field1,field2,field3");
+    csb.addOption(LuceneCliStrings.LUCENE_CREATE_INDEX__SERIALIZER,
+        PrimitiveSerializer.class.getCanonicalName());
+
+    // Execute Gfsh command.
+    gfshConnector.executeAndVerifyCommand(csb.toString());
+  }
+
   private void destroyLuceneIndexUsingGfsh(String indexName) throws Exception {
     // Execute Gfsh command to destroy lucene index.
     CommandStringBuilder csb = new CommandStringBuilder(LuceneCliStrings.LUCENE_DESTROY_INDEX);

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

Mime
View raw message