|
@@ -71,6 +71,16 @@ public enum LuceneFilesExtensions {
|
|
|
// Lucene 9.0 indexed vectors metadata
|
|
// Lucene 9.0 indexed vectors metadata
|
|
|
VEM("vem","Vector Metadata", true, false);
|
|
VEM("vem","Vector Metadata", true, false);
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Allow plugin developers of custom codecs to opt out of the assertion in {@link #fromExtension}
|
|
|
|
|
+ * that checks that all encountered file extensions are known to this class.
|
|
|
|
|
+ * In the future, we would like to add a proper plugin extension point for this.
|
|
|
|
|
+ */
|
|
|
|
|
+ private static boolean allowUnknownLuceneFileExtensions() {
|
|
|
|
|
+ return Boolean.parseBoolean(
|
|
|
|
|
+ System.getProperty("es.allow_unknown_lucene_file_extensions", "false"));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Lucene file's extension.
|
|
* Lucene file's extension.
|
|
|
*/
|
|
*/
|
|
@@ -128,7 +138,7 @@ public enum LuceneFilesExtensions {
|
|
|
public static LuceneFilesExtensions fromExtension(String ext) {
|
|
public static LuceneFilesExtensions fromExtension(String ext) {
|
|
|
if (ext != null && ext.isEmpty() == false) {
|
|
if (ext != null && ext.isEmpty() == false) {
|
|
|
final LuceneFilesExtensions extension = extensions.get(ext);
|
|
final LuceneFilesExtensions extension = extensions.get(ext);
|
|
|
- assert extension != null: "unknown Lucene file extension [" + ext + ']';
|
|
|
|
|
|
|
+ assert allowUnknownLuceneFileExtensions() || extension != null: "unknown Lucene file extension [" + ext + ']';
|
|
|
return extension;
|
|
return extension;
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|