public static Date getFormattedDate(String dateString) { return searchDateFormat.parseDateTime(dateString).toDate(); }
public static Date getFormattedDate(final String dateString) { return searchDateFormat.parseDateTime(dateString).toDate(); }
/** * Parse ISO datetime string. * * @param dateString to parse * @return parsed date * @throws IllegalArgumentException if date is not parseable */ public static final Date parseISODateTime(String dateString) { if (Utils.isEmpty(dateString)) return null; return ISODateTimeFormat.dateTimeParser().parseDateTime(dateString).toDate(); }
DateHistogram h = (DateHistogram) agg; for (DateHistogram.Bucket b : h.getBuckets()) { List<MultiBucketsAggregation.Bucket> l = bucketsByKey.get(b.getKeyAsDate().toDate()); if (l == null) { l = new ArrayList<>();
/** * Parse date string with minute precise - so seconds and milliseconds are set to 0. Used because JQL allows only * minute precise queries. * * @param dateString to parse * @return parsed date rounded to minute precise * @throws IllegalArgumentException if date is not parseable */ public static Date parseISODateTimeWithMinutePrecise(String dateString) { if (Utils.isEmpty(dateString)) return null; return DateTimeUtils.roundDateTimeToMinutePrecise(ISODateTimeFormat.dateTimeParser().parseDateTime(dateString) .toDate()); }
@Override public HistogramResult getHistogramResults(String name) { List<HistogramBucket> buckets = new ArrayList<HistogramBucket>(); Aggregation agg = this.searchResponse.getAggregations().get(name); if (agg == null) { return null; } if (agg instanceof DateHistogram) { DateHistogram h = (DateHistogram) agg; for (DateHistogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKeyAsDate().toDate(), b.getDocCount())); } } else if (agg instanceof Histogram) { Histogram h = (Histogram) agg; for (Histogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKey(), b.getDocCount())); } } else { throw new VertexiumException("Aggregation is not a histogram: " + agg.getClass().getName()); } return new HistogramResult(buckets); }
@Override public HistogramResult getHistogramResults(String name) { List<HistogramBucket> buckets = new ArrayList<HistogramBucket>(); Aggregation agg = this.searchResponse.getAggregations().get(name); if (agg == null) { return null; } if (agg instanceof DateHistogram) { DateHistogram h = (DateHistogram) agg; for (DateHistogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKeyAsDate().toDate(), b.getDocCount())); } } else if (agg instanceof Histogram) { Histogram h = (Histogram) agg; for (Histogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKey(), b.getDocCount())); } } else { throw new SecureGraphException("Aggregation is not a histogram: " + agg.getClass().getName()); } return new HistogramResult(buckets); }
@Override public HistogramResult getHistogramResults(String name) { List<HistogramBucket> buckets = new ArrayList<HistogramBucket>(); Aggregation agg = this.searchResponse.getAggregations().get(name); if (agg == null) { return null; } if (agg instanceof DateHistogram) { DateHistogram h = (DateHistogram) agg; for (DateHistogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKeyAsDate().toDate(), b.getDocCount())); } } else if (agg instanceof Histogram) { Histogram h = (Histogram) agg; for (Histogram.Bucket b : h.getBuckets()) { buckets.add(new HistogramBucket(b.getKey(), b.getDocCount())); } } else { throw new SecureGraphException("Aggregation is not a histogram: " + agg.getClass().getName()); } return new HistogramResult(buckets); }
product.setTitle("Title " + i); product.setDescription("Description" + i); product.setAvailableOn(new DateTime().plusDays(i).toDate()); product.addKeyword("Keyword " + i); product.setPrice(BigDecimal.valueOf(i));
product.setTitle("Title " + i); product.setDescription("Description" + i); product.setAvailableOn(new DateTime().plusDays(i).toDate()); product.addKeyword("Keyword " + i); product.setPrice(BigDecimal.valueOf(i));