forked from vivo-community/scholars-discovery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now able to use what Solr has defined on startup to validate and determine create/update/remove of schema scaffold.
- Loading branch information
Showing
11 changed files
with
369 additions
and
107 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
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
36 changes: 32 additions & 4 deletions
36
src/main/java/edu/tamu/scholars/middleware/discovery/service/component/Indexer.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 |
---|---|---|
@@ -1,29 +1,57 @@ | ||
package edu.tamu.scholars.middleware.discovery.service.component; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import edu.tamu.scholars.middleware.discovery.model.AbstractIndexDocument; | ||
|
||
/** | ||
* Indexer interface so far. See solr.SolrIndexer ^^^ and ..IndexService <<<. | ||
*/ | ||
public interface Indexer { | ||
|
||
/** | ||
* Called to initialize index. | ||
* Scaffold in memory fields expected from concrete discovery.model. | ||
*/ | ||
public void init(); | ||
public void scaffold(); | ||
|
||
/** | ||
* To be called when not needing to initialize index. | ||
* Everything the application needs the solr collection to have specified. | ||
*/ | ||
public void scaffold(); | ||
public void init(List<Map<String, Object>> schema); | ||
|
||
/** | ||
* Index a batch of abstract index documents. | ||
* | ||
* @param documents batch to index | ||
*/ | ||
public void index(Collection<AbstractIndexDocument> documents); | ||
|
||
/** | ||
* Index an abstract index documents. | ||
* | ||
* @param document individual | ||
*/ | ||
public void index(AbstractIndexDocument document); | ||
|
||
/** | ||
* Used to flush commits. | ||
*/ | ||
public void optimize(); | ||
|
||
/** | ||
* Reflected type. | ||
* | ||
* @return the typed class for abstract index document | ||
*/ | ||
public Class<AbstractIndexDocument> type(); | ||
|
||
/** | ||
* The concrete name provided by the implementation. Please place in discovery level constants class as final static. | ||
* | ||
* @return name for the implementation | ||
*/ | ||
public String name(); | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/edu/tamu/scholars/middleware/discovery/service/component/NamedTypedField.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,14 @@ | ||
package edu.tamu.scholars.middleware.discovery.service.component; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
import edu.tamu.scholars.middleware.discovery.annotation.FieldType; | ||
|
||
// TODO: make class members private and add getters and setters | ||
// use public static method and private constructor | ||
// check if any class members can be final | ||
public class NamedTypedField { | ||
public String name; | ||
public FieldType fieldType; | ||
public Field field; | ||
} |
14 changes: 14 additions & 0 deletions
14
...tamu/scholars/middleware/discovery/service/component/solr/SolrCollectionAdminUtility.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,14 @@ | ||
package edu.tamu.scholars.middleware.discovery.service.component.solr; | ||
|
||
public class SolrCollectionAdminUtility { | ||
|
||
public final static String SOLR_CONSTANT_PING_RESPONSE_STATUS = "status"; | ||
public final static String SOLR_CONSTANT_PING_RESPONSE_MESSAGE = "message"; | ||
public final static String SOLR_CONSTANT_PING_RESPONSE_OK = "OK"; | ||
|
||
private SolrCollectionAdminUtility() { | ||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.