private List<SimpleCollectionData> transform(List<FulltextSearchResult> searchResult) { List<SimpleCollectionData> results = new LinkedList<>(); for (FulltextSearchResult result : searchResult) { String id = result.getField(FIELD_EXID).getValues()[0]; String title = result.getField(IndexSchemaFactoryUtils.getSortField(FIELD_NAME)).getValues()[0]; String visibility = result.getField(FIELD_VISIBILITY).getValues()[0]; DateTime creation = DateTime.parse(result.getField(FIELD_DATE+ SEP + "creationTimestamp").getValues()[0]); results.add(new SimpleCollectionData(id, title, visibility,creation.toDate())); } return results; }
private SimpleElementData transform(FulltextSearchResult searchResult) { String id = searchResult.getField(FIELD_EXID).getValues()[0]; String title = searchResult.getField(IndexSchemaFactoryUtils.getSortField(FIELD_NAME)).getValues()[0]; String type = searchResult.getField(FIELD_TYPE).getValues()[0]; DateTime creation = DateTime.parse(searchResult.getField(FIELD_DATE + SEP + "creationTimestamp").getValues()[0]); return new SimpleElementData(id, title, type, creation.toDate()); }
private List<CollectionContentData> transformContent(List<FulltextSearchResult> searchResult) { List<CollectionContentData> results = new LinkedList<>(); for (FulltextSearchResult result : searchResult) { String contentId = result.getField(FIELD_CONTENT_ID).getValues()[0]; String title = result.getField(IndexSchemaFactoryUtils.getSortField(FIELD_NAME)).getValues()[0]; String type = result.getField(FIELD_TYPE).getValues()[0]; results.add(new CollectionContentData(contentId, title, CollectionDocumentType.valueOf(type))); } return results; }
private List<CollectionContentData> transformCollections(List<FulltextSearchResult> searchResult) { List<CollectionContentData> results = new LinkedList<>(); for (FulltextSearchResult result : searchResult) { String collectionId = result.getField(FIELD_COLLECTION_ID).getValues()[0]; String title = (collectionId!=null)?collectionService.fetchCollection(collectionId).getName():""; results.add(new CollectionContentData(collectionId, title, CollectionDocumentType.COLLECTION)); } return results; }
private List<BaseResourceData> transform(List<FulltextSearchResult> searchResult) { List<BaseResourceData> results = new LinkedList<>(); for (FulltextSearchResult result : searchResult) { results.add(new BaseResourceData(result.getDocId(), result.getField(getSortField(FIELD_NAME)).getValues()[0])); } return results; }