Skip to content

Commit

Permalink
Update classes in example plugin (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakn7 authored Oct 9, 2024
1 parent dfd991f commit 0c58fce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -46,7 +46,7 @@ public class ExamplePluginTest extends ServerTestCase {
private static final ExamplePlugin examplePlugin = new ExamplePlugin(getConfig());

@Override
protected List<Plugin> getPlugins(LuceneServerConfiguration configuration) {
protected List<Plugin> getPlugins(NrtsearchConfig configuration) {
return List.of(examplePlugin);
}

Expand Down Expand Up @@ -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()));
}
}

0 comments on commit 0c58fce

Please sign in to comment.