getDataFileInfoForPermissionIndexing(Long id) {
+ return em.createNamedQuery("DataFile.getDataFileInfoForPermissionIndexing", DataFileProxy.class)
+ .setParameter(1, id)
+ .getResultStream();
+ }
+
+ /**
+ * A lightweight proxy for DataFile objects used during permission indexing. This class avoids loading the full DataFile entity from the database when only basic properties are needed for indexing,
+ * improving performance for large datasets.
+ */
+ public static class DataFileProxy {
+
+ private final Long id;
+ private final String name;
+ private final boolean released;
+
+ /**
+ * Creates a new DataFileProxy with the specified properties.
+ *
+ * @param id
+ * The ID of the data file
+ * @param label
+ * The label/name of the data file
+ * @param restricted
+ * Whether the file is restricted
+ * @param released
+ * Whether the file is released
+ */
+ public DataFileProxy(FileMetadata fmd) {
+ DataFile df = fmd.getDataFile();
+ this.id = df.getId();
+ this.name = fmd.getLabel();
+ this.released = df.isReleased();
+ }
+
+ public DataFileProxy(String label, Long id, Date publicationDate) {
+ this.id = id;
+ this.name = label;
+ this.released = publicationDate != null;
+ }
+
+ public boolean isReleased() {
+ return released;
+ }
+
+ public Long getFileId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public DataFile getMinimalDataFile() {
+ DataFile df = new DataFile();
+ df.setId(id);
+ return df;
+ }
+ }
}
diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java b/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java
index bc32e250be5..afc698b418b 100644
--- a/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java
+++ b/src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java
@@ -67,11 +67,13 @@ public enum JvmSettings {
SOLR_PROT(SCOPE_SOLR, "protocol"),
SOLR_CORE(SCOPE_SOLR, "core"),
SOLR_PATH(SCOPE_SOLR, "path"),
+ MIN_FILES_TO_USE_PROXY(SCOPE_SOLR, "min-files-to-use-proxy"),
+
// INDEX CONCURENCY
SCOPE_SOLR_CONCURENCY(SCOPE_SOLR, "concurrency"),
MAX_ASYNC_INDEXES(SCOPE_SOLR_CONCURENCY, "max-async-indexes"),
-
+
// RSERVE CONNECTION
SCOPE_RSERVE(PREFIX, "rserve"),
RSERVE_HOST(SCOPE_RSERVE, "host"),
diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java
index 5b0a178969b..6d96ad4abf6 100644
--- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java
+++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java
@@ -168,27 +168,6 @@ public enum Key {
* to from the footer.
*/
ApplicationPrivacyPolicyUrl,
- /**
- * A boolean defining if indexing and search should respect the concept
- * of "permission root".
- *
- *
- *
- * If we ignore permissionRoot at index time, we should blindly give
- * search ("discoverability") access to people and group who have access
- * defined in a parent dataverse, all the way back to the root.
- *
- *
- *
- * If we respect permissionRoot, this means that the dataverse being
- * indexed is an island of permissions all by itself. We should not look
- * to its parent to see if more people and groups might be able to
- * search the DvObjects within it. We would assume no implicit
- * inheritance of permissions. In this mode, all permissions must be
- * explicitly defined on DvObjects. No implied inheritance.
- *
- */
- SearchRespectPermissionRoot,
/**
* Solr hostname and port, such as "localhost:8983".
* @deprecated New installations should not use this database setting, but use {@link JvmSettings#SOLR_HOST}
diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml
index e6224dcdf01..151410c04c2 100644
--- a/src/main/resources/META-INF/persistence.xml
+++ b/src/main/resources/META-INF/persistence.xml
@@ -18,6 +18,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/test/java/edu/harvard/iq/dataverse/search/IndexServiceBeanTest.java b/src/test/java/edu/harvard/iq/dataverse/search/IndexServiceBeanTest.java
index 2b54a4b12cd..eda9b995db5 100644
--- a/src/test/java/edu/harvard/iq/dataverse/search/IndexServiceBeanTest.java
+++ b/src/test/java/edu/harvard/iq/dataverse/search/IndexServiceBeanTest.java
@@ -126,6 +126,7 @@ private IndexableDataset createIndexableDataset() {
final Dataset dataset = MocksFactory.makeDataset();
dataset.setGlobalId(new GlobalId(AbstractDOIProvider.DOI_PROTOCOL,"10.666", "FAKE/fake", "/", AbstractDOIProvider.DOI_RESOLVER_URL, null));
final DatasetVersion datasetVersion = dataset.getCreateVersion(null);
+ datasetVersion.setId(1L);
DatasetField field = createCVVField("language", "English", false);
datasetVersion.getDatasetFields().add(field);
final IndexableDataset indexableDataset = new IndexableDataset(datasetVersion);