Skip to content

Commit

Permalink
#6300 add Version Numbers to Search API
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Dec 6, 2019
1 parent d5116ef commit ad3accf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public Response search(
paginationStart,
dataRelatedToMe,
numResultsPerPage,
queryEntities
true //SEK get query entities always for search API 12/6/2019
);
} catch (SearchException ex) {
Throwable cause = ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ public JsonObjectBuilder json(boolean showRelevance, boolean showEntityIds, bool

} else {
if (this.entity.isInstanceofDataset()) {
System.out.print("Instance of Dataset: " + this.entity.getStorageIdentifier());
nullSafeJsonBuilder.add("storageIdentifier", this.entity.getStorageIdentifier());
Dataset ds = (Dataset) this.entity;
DatasetVersion dv;
Expand All @@ -587,6 +586,10 @@ public JsonObjectBuilder json(boolean showRelevance, boolean showEntityIds, bool
nullSafeJsonBuilder.add("subjects", subjects);
nullSafeJsonBuilder.add("versionId", dv.getId());
nullSafeJsonBuilder.add("versionState", dv.getVersionState().toString());
if(this.isPublishedState()){
nullSafeJsonBuilder.add("majorVersion", dv.getVersionNumber());
nullSafeJsonBuilder.add("minorVersion", dv.getMinorVersionNumber());
}
nullSafeJsonBuilder.add("createdAt", ds.getCreateDate());
nullSafeJsonBuilder.add("updatedAt", ds.getModificationTime());

Expand Down

0 comments on commit ad3accf

Please sign in to comment.