Skip to content

Commit fae7a05

Browse files
committed
BWT issues
1 parent 63a16db commit fae7a05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/SearchBusinessRules.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
import org.elasticsearch.plugins.SearchPlugin.RetrieverSpec;
1414
import org.elasticsearch.xcontent.ParseField;
1515
import org.elasticsearch.xpack.searchbusinessrules.retriever.PinnedRetrieverBuilder;
16+
import org.elasticsearch.TransportVersion;
17+
import org.elasticsearch.TransportVersions;
1618

1719
import java.util.List;
1820

1921
import static java.util.Collections.singletonList;
22+
import static java.util.Collections.emptyList;
2023

2124
public class SearchBusinessRules extends Plugin implements SearchPlugin {
2225

@@ -27,7 +30,10 @@ public List<QuerySpec<?>> getQueries() {
2730

2831
@Override
2932
public List<RetrieverSpec<?>> getRetrievers() {
30-
return singletonList(new RetrieverSpec<>(new ParseField(PinnedRetrieverBuilder.NAME), PinnedRetrieverBuilder::fromXContent));
33+
if (TransportVersion.current().onOrAfter(TransportVersions.PINNED_RETRIEVER)) {
34+
return singletonList(new RetrieverSpec<>(new ParseField(PinnedRetrieverBuilder.NAME), PinnedRetrieverBuilder::fromXContent));
35+
}
36+
return emptyList();
3137
}
3238

3339
}

0 commit comments

Comments
 (0)