-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: default no-op indexer and searcher added, no enforcement to dow…
…nload a search plugin #4459
- Loading branch information
Showing
7 changed files
with
291 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
mica-search/src/main/java/org/obiba/mica/search/basic/DefaultIndexer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Copyright (c) 2024 OBiBa. All rights reserved. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the GNU Public License v3.0. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.obiba.mica.search.basic; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import org.obiba.mica.spi.search.IndexFieldMapping; | ||
import org.obiba.mica.spi.search.Indexable; | ||
import org.obiba.mica.spi.search.Indexer; | ||
import org.springframework.data.domain.Persistable; | ||
|
||
import java.util.Map; | ||
|
||
public class DefaultIndexer implements Indexer { | ||
@Override | ||
public void index(String indexName, Persistable<String> persistable) { | ||
|
||
} | ||
|
||
@Override | ||
public void index(String indexName, Persistable<String> persistable, Persistable<String> parent) { | ||
|
||
} | ||
|
||
@Override | ||
public void index(String indexName, Indexable indexable) { | ||
|
||
} | ||
|
||
@Override | ||
public void index(String indexName, Indexable indexable, Indexable parent) { | ||
|
||
} | ||
|
||
@Override | ||
public void reIndexAllIndexables(String indexName, Iterable<? extends Indexable> persistables) { | ||
|
||
} | ||
|
||
@Override | ||
public void reindexAll(String indexName, Iterable<? extends Persistable<String>> persistables) { | ||
|
||
} | ||
|
||
@Override | ||
public void indexAll(String indexName, Iterable<? extends Persistable<String>> persistables) { | ||
|
||
} | ||
|
||
@Override | ||
public void indexAll(String indexName, Iterable<? extends Persistable<String>> persistables, Persistable<String> parent) { | ||
|
||
} | ||
|
||
@Override | ||
public void indexAllIndexables(String indexName, Iterable<? extends Indexable> indexables) { | ||
|
||
} | ||
|
||
@Override | ||
public void indexAllIndexables(String indexName, Iterable<? extends Indexable> indexables, @Nullable String parentId) { | ||
|
||
} | ||
|
||
@Override | ||
public void delete(String indexName, Persistable<String> persistable) { | ||
|
||
} | ||
|
||
@Override | ||
public void delete(String indexName, Indexable indexable) { | ||
|
||
} | ||
|
||
@Override | ||
public void delete(String indexName, String[] types, Map.Entry<String, String> termQuery) { | ||
|
||
} | ||
|
||
@Override | ||
public void delete(String indexName, String type, Map.Entry<String, String> termQuery) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean hasIndex(String indexName) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void dropIndex(String indexName) { | ||
|
||
} | ||
|
||
@Override | ||
public IndexFieldMapping getIndexfieldMapping(String indexName, String type) { | ||
return null; | ||
} | ||
} |
107 changes: 107 additions & 0 deletions
107
mica-search/src/main/java/org/obiba/mica/search/basic/DefaultSearcher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright (c) 2024 OBiBa. All rights reserved. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the GNU Public License v3.0. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.obiba.mica.search.basic; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import org.obiba.mica.spi.search.QueryScope; | ||
import org.obiba.mica.spi.search.Searcher; | ||
import org.obiba.mica.spi.search.support.JoinQuery; | ||
import org.obiba.mica.spi.search.support.Query; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
|
||
|
||
public class DefaultSearcher implements Searcher { | ||
|
||
@Override | ||
public JoinQuery makeJoinQuery(String rql) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Query makeQuery(String rql) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Query andQuery(Query... queries) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DocumentResults find(String indexName, String type, String rql, IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public DocumentResults count(String indexName, String type, String rql, IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public List<String> suggest(String indexName, String type, int limit, String locale, String queryString, String defaultFieldName) { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public InputStream getDocumentById(String indexName, String type, String id) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public InputStream getDocumentByClassName(String indexName, String type, Class clazz, String id) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DocumentResults getDocumentsByClassName(String indexName, String type, Class clazz, int from, int limit, @Nullable String sort, @Nullable String order, @Nullable String queryString, @Nullable TermFilter termFilter, @Nullable IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public DocumentResults getDocuments(String indexName, String type, int from, int limit, @Nullable String sort, @Nullable String order, @Nullable String queryString, @Nullable TermFilter termFilter, @Nullable IdFilter idFilter, @Nullable List<String> fields, @Nullable List<String> excludedFields) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public long countDocumentsWithField(String indexName, String type, String field) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public DocumentResults query(String indexName, String type, Query query, QueryScope scope, List<String> mandatorySourceFields, Properties aggregationProperties, @Nullable IdFilter idFilter) throws IOException { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public DocumentResults aggregate(String indexName, String type, Query query, Properties aggregationProperties, IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public DocumentResults cover(String indexName, String type, Query query, Properties aggregationProperties, @Nullable IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public DocumentResults cover(String indexName, String type, Query query, Properties aggregationProperties, Map<String, Properties> subAggregationProperties, @Nullable IdFilter idFilter) { | ||
return new EmptyDocumentResults(); | ||
} | ||
|
||
@Override | ||
public Map<Object, Object> harmonizationStatusAggregation(String datasetId, int size, String aggregationFieldName, String statusFieldName) { | ||
return Map.of(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
mica-search/src/main/java/org/obiba/mica/search/basic/EmptyDocumentResults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2024 OBiBa. All rights reserved. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the GNU Public License v3.0. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.obiba.mica.search.basic; | ||
|
||
import org.obiba.mica.spi.search.Searcher; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class EmptyDocumentResults implements Searcher.DocumentResults { | ||
@Override | ||
public long getTotal() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public List<Searcher.DocumentResult> getDocuments() { | ||
return List.of(); | ||
} | ||
|
||
@Override | ||
public Map<String, Long> getAggregation(String field) { | ||
return Map.of(); | ||
} | ||
|
||
@Override | ||
public List<Searcher.DocumentAggregation> getAggregations() { | ||
return List.of(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters