From 0c58fce6d5036bb27b388c5a48cacd6ceb90243a Mon Sep 17 00:00:00 2001 From: Sarthak Nandi Date: Wed, 9 Oct 2024 09:06:04 -0700 Subject: [PATCH] Update classes in example plugin (#761) --- .../yelp/nrtsearch/plugins/example/ExamplePlugin.java | 6 +++--- .../nrtsearch/plugins/example/ExamplePluginTest.java | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example-plugin/src/main/java/com/yelp/nrtsearch/plugins/example/ExamplePlugin.java b/example-plugin/src/main/java/com/yelp/nrtsearch/plugins/example/ExamplePlugin.java index b9ebdc3b3..57d29ac65 100644 --- a/example-plugin/src/main/java/com/yelp/nrtsearch/plugins/example/ExamplePlugin.java +++ b/example-plugin/src/main/java/com/yelp/nrtsearch/plugins/example/ExamplePlugin.java @@ -15,8 +15,8 @@ */ package com.yelp.nrtsearch.plugins.example; -import com.yelp.nrtsearch.server.config.LuceneServerConfiguration; -import com.yelp.nrtsearch.server.luceneserver.analysis.AnalysisProvider; +import com.yelp.nrtsearch.server.analysis.AnalysisProvider; +import com.yelp.nrtsearch.server.config.NrtsearchConfig; import com.yelp.nrtsearch.server.plugins.AnalysisPlugin; import com.yelp.nrtsearch.server.plugins.CustomRequestPlugin; import com.yelp.nrtsearch.server.plugins.Plugin; @@ -30,7 +30,7 @@ public class ExamplePlugin extends Plugin implements AnalysisPlugin, CustomReque private final String availableAnalyzers = String.join(",", getAnalyzers().keySet()); // Constructor that accepts LuceneServerConfiguration object is required - public ExamplePlugin(LuceneServerConfiguration configuration) {} + public ExamplePlugin(NrtsearchConfig configuration) {} @Override public String id() { diff --git a/example-plugin/src/test/java/com/yelp/nrtsearch/plugins/example/ExamplePluginTest.java b/example-plugin/src/test/java/com/yelp/nrtsearch/plugins/example/ExamplePluginTest.java index 25d94bc62..1b9eb747b 100644 --- a/example-plugin/src/test/java/com/yelp/nrtsearch/plugins/example/ExamplePluginTest.java +++ b/example-plugin/src/test/java/com/yelp/nrtsearch/plugins/example/ExamplePluginTest.java @@ -17,7 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.yelp.nrtsearch.server.config.LuceneServerConfiguration; +import com.yelp.nrtsearch.server.ServerTestCase; +import com.yelp.nrtsearch.server.config.NrtsearchConfig; import com.yelp.nrtsearch.server.grpc.AddDocumentRequest; import com.yelp.nrtsearch.server.grpc.AddDocumentRequest.MultiValuedField; import com.yelp.nrtsearch.server.grpc.CustomRequest; @@ -27,7 +28,6 @@ import com.yelp.nrtsearch.server.grpc.Query; import com.yelp.nrtsearch.server.grpc.SearchRequest; import com.yelp.nrtsearch.server.grpc.SearchResponse; -import com.yelp.nrtsearch.server.luceneserver.ServerTestCase; import com.yelp.nrtsearch.server.plugins.Plugin; import io.grpc.testing.GrpcCleanupRule; import java.io.ByteArrayInputStream; @@ -46,7 +46,7 @@ public class ExamplePluginTest extends ServerTestCase { private static final ExamplePlugin examplePlugin = new ExamplePlugin(getConfig()); @Override - protected List getPlugins(LuceneServerConfiguration configuration) { + protected List getPlugins(NrtsearchConfig configuration) { return List.of(examplePlugin); } @@ -121,8 +121,8 @@ public void testAnalysisForSearch() { assertThat(response.getHitsCount()).isEqualTo(1); } - private static LuceneServerConfiguration getConfig() { + private static NrtsearchConfig getConfig() { String config = "nodeName: \"lucene_server_foo\""; - return new LuceneServerConfiguration(new ByteArrayInputStream(config.getBytes())); + return new NrtsearchConfig(new ByteArrayInputStream(config.getBytes())); } }