Skip to content

Commit c0589a3

Browse files
authored
Merge pull request #2075 from dadoonet/fallback-build_flavor
Be more permissive with `build_flavor` check.
2 parents ca7d355 + 781c477 commit c0589a3

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

elasticsearch-client/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/ElasticsearchClient.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,19 @@ public String getVersion() throws ElasticsearchClientException {
262262
minorVersion = extractMinorVersion(version);
263263
serverless = false;
264264

265-
if ("serverless".equals(document.read("$.version.build_flavor"))) {
266-
logger.debug("We are running on Elastic serverless cloud so we can not consider version number.");
267-
serverless = true;
268-
version = "serverless";
269-
majorVersion = 99;
270-
minorVersion = 999;
265+
try {
266+
if ("serverless".equals(document.read("$.version.build_flavor"))) {
267+
logger.debug("We are running on Elastic serverless cloud so we can not consider version number.");
268+
serverless = true;
269+
version = "serverless";
270+
majorVersion = 99;
271+
minorVersion = 999;
272+
}
273+
} catch (PathNotFoundException e) {
274+
// We are not running an official Elasticsearch version
275+
logger.info("FSCrawler only supports Elasticsearch official distribution. " +
276+
"You are running another custom distribution. We will not be able to use some features like " +
277+
"semantic search.");
271278
}
272279
logger.debug("get version returns {} and {} as the major version number", version, majorVersion);
273280
return version;

0 commit comments

Comments
 (0)