Skip to content

Commit

Permalink
Fixing bugs with querying date times
Browse files Browse the repository at this point in the history
rh-pre-commit.version: 2.0.3
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
computate committed Dec 13, 2023
1 parent 998e1e3 commit ba0486e
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public static ZonedDateTime staticSetCreated(SiteRequestEnUS siteRequest_, Strin
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -394,7 +394,7 @@ public static Date staticSearchCreated(SiteRequestEnUS siteRequest_, ZonedDateTi
}

public static String staticSearchStrCreated(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqCreated(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -450,7 +450,7 @@ public static ZonedDateTime staticSetModified(SiteRequestEnUS siteRequest_, Stri
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -474,7 +474,7 @@ public static Date staticSearchModified(SiteRequestEnUS siteRequest_, ZonedDateT
}

public static String staticSearchStrModified(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqModified(SiteRequestEnUS siteRequest_, String o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ public static ZonedDateTime staticSetCompleted(SiteRequestEnUS siteRequest_, Str
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -580,7 +580,7 @@ public static Date staticSearchCompleted(SiteRequestEnUS siteRequest_, ZonedDate
}

public static String staticSearchStrCompleted(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqCompleted(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -692,7 +692,7 @@ public static ZonedDateTime staticSetCreated(SiteRequestEnUS siteRequest_, Strin
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -716,7 +716,7 @@ public static Date staticSearchCreated(SiteRequestEnUS siteRequest_, ZonedDateTi
}

public static String staticSearchStrCreated(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqCreated(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -772,7 +772,7 @@ public static ZonedDateTime staticSetModified(SiteRequestEnUS siteRequest_, Stri
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -796,7 +796,7 @@ public static Date staticSearchModified(SiteRequestEnUS siteRequest_, ZonedDateT
}

public static String staticSearchStrModified(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqModified(SiteRequestEnUS siteRequest_, String o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3010,7 +3010,7 @@ public static ZonedDateTime staticSetRangeEnd(SiteRequestEnUS siteRequest_, Stri
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -3034,7 +3034,7 @@ public static Date staticSearchRangeEnd(SiteRequestEnUS siteRequest_, ZonedDateT
}

public static String staticSearchStrRangeEnd(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqRangeEnd(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -3086,7 +3086,7 @@ public static ZonedDateTime staticSetRangeStart(SiteRequestEnUS siteRequest_, St
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -3110,7 +3110,7 @@ public static Date staticSearchRangeStart(SiteRequestEnUS siteRequest_, ZonedDat
}

public static String staticSearchStrRangeStart(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqRangeStart(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -3274,7 +3274,7 @@ public static ZonedDateTime staticSetDefaultRangeEnd(SiteRequestEnUS siteRequest
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -3298,7 +3298,7 @@ public static Date staticSearchDefaultRangeEnd(SiteRequestEnUS siteRequest_, Zon
}

public static String staticSearchStrDefaultRangeEnd(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqDefaultRangeEnd(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -3350,7 +3350,7 @@ public static ZonedDateTime staticSetDefaultRangeStart(SiteRequestEnUS siteReque
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -3374,7 +3374,7 @@ public static Date staticSearchDefaultRangeStart(SiteRequestEnUS siteRequest_, Z
}

public static String staticSearchStrDefaultRangeStart(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqDefaultRangeStart(SiteRequestEnUS siteRequest_, String o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public static ZonedDateTime staticSetCreated(SiteRequestEnUS siteRequest_, Strin
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -328,7 +328,7 @@ public static Date staticSearchCreated(SiteRequestEnUS siteRequest_, ZonedDateTi
}

public static String staticSearchStrCreated(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqCreated(SiteRequestEnUS siteRequest_, String o) {
Expand Down Expand Up @@ -384,7 +384,7 @@ public static ZonedDateTime staticSetModified(SiteRequestEnUS siteRequest_, Stri
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -408,7 +408,7 @@ public static Date staticSearchModified(SiteRequestEnUS siteRequest_, ZonedDateT
}

public static String staticSearchStrModified(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqModified(SiteRequestEnUS siteRequest_, String o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public static ZonedDateTime staticSetDateTime(SiteRequestEnUS siteRequest_, Stri
else if(StringUtils.endsWith(o, "Z"))
return o == null ? null : Instant.parse(o).atZone(Optional.ofNullable(siteRequest_).map(r -> r.getConfig()).map(config -> config.getString(ConfigKeys.SITE_ZONE)).map(z -> ZoneId.of(z)).orElse(ZoneId.of("UTC"))).truncatedTo(ChronoUnit.MILLIS);
else if(StringUtils.contains(o, "T"))
return o == null ? null : ZonedDateTime.parse(o, DateTimeFormatter.ISO_DATE_TIME).truncatedTo(ChronoUnit.MILLIS);
return o == null ? null : ZonedDateTime.parse(o, ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER).truncatedTo(ChronoUnit.MILLIS);
else
return o == null ? null : LocalDate.parse(o, DateTimeFormatter.ISO_DATE).atStartOfDay(ZoneId.of(siteRequest_.getConfig().getString(ConfigKeys.SITE_ZONE))).truncatedTo(ChronoUnit.MILLIS);
}
Expand All @@ -440,7 +440,7 @@ public static Date staticSearchDateTime(SiteRequestEnUS siteRequest_, ZonedDateT
}

public static String staticSearchStrDateTime(SiteRequestEnUS siteRequest_, Date o) {
return "\"" + DateTimeFormatter.ISO_DATE_TIME.format(o.toInstant().atOffset(ZoneOffset.UTC)) + "\"";
return ComputateZonedDateTimeSerializer.UTC_DATE_TIME_FORMATTER.format(o.toInstant().atOffset(ZoneOffset.UTC));
}

public static String staticSearchFqDateTime(SiteRequestEnUS siteRequest_, String o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ public String searchSiteHtmFq(SearchList<SiteHtm> searchList, String entityVar,
if(varIndexed == null)
throw new RuntimeException(String.format("\"%s\" is not an indexed entity. ", entityVar));
if(StringUtils.startsWith(valueIndexed, "[")) {
String[] fqs = StringUtils.substringBefore(StringUtils.substringAfter(valueIndexed, "["), "]").split(" TO ");
String[] fqs = StringUtils.substringAfter(StringUtils.substringBeforeLast(valueIndexed, "]"), "[").split(" TO ");
if(fqs.length != 2)
throw new RuntimeException(String.format("\"%s\" invalid range query. ", valueIndexed));
String fq1 = fqs[0].equals("*") ? fqs[0] : SiteHtm.staticSearchFqForClass(entityVar, searchList.getSiteRequest_(SiteRequestEnUS.class), fqs[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ public String searchSitePageFq(SearchList<SitePage> searchList, String entityVar
if(varIndexed == null)
throw new RuntimeException(String.format("\"%s\" is not an indexed entity. ", entityVar));
if(StringUtils.startsWith(valueIndexed, "[")) {
String[] fqs = StringUtils.substringBefore(StringUtils.substringAfter(valueIndexed, "["), "]").split(" TO ");
String[] fqs = StringUtils.substringAfter(StringUtils.substringBeforeLast(valueIndexed, "]"), "[").split(" TO ");
if(fqs.length != 2)
throw new RuntimeException(String.format("\"%s\" invalid range query. ", valueIndexed));
String fq1 = fqs[0].equals("*") ? fqs[0] : SitePage.staticSearchFqForClass(entityVar, searchList.getSiteRequest_(SiteRequestEnUS.class), fqs[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ public String searchSystemEventFq(SearchList<SystemEvent> searchList, String ent
if(varIndexed == null)
throw new RuntimeException(String.format("\"%s\" is not an indexed entity. ", entityVar));
if(StringUtils.startsWith(valueIndexed, "[")) {
String[] fqs = StringUtils.substringBefore(StringUtils.substringAfter(valueIndexed, "["), "]").split(" TO ");
String[] fqs = StringUtils.substringAfter(StringUtils.substringBeforeLast(valueIndexed, "]"), "[").split(" TO ");
if(fqs.length != 2)
throw new RuntimeException(String.format("\"%s\" invalid range query. ", valueIndexed));
String fq1 = fqs[0].equals("*") ? fqs[0] : SystemEvent.staticSearchFqForClass(entityVar, searchList.getSiteRequest_(SiteRequestEnUS.class), fqs[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ public String searchSiteUserFq(SearchList<SiteUser> searchList, String entityVar
if(varIndexed == null)
throw new RuntimeException(String.format("\"%s\" is not an indexed entity. ", entityVar));
if(StringUtils.startsWith(valueIndexed, "[")) {
String[] fqs = StringUtils.substringBefore(StringUtils.substringAfter(valueIndexed, "["), "]").split(" TO ");
String[] fqs = StringUtils.substringAfter(StringUtils.substringBeforeLast(valueIndexed, "]"), "[").split(" TO ");
if(fqs.length != 2)
throw new RuntimeException(String.format("\"%s\" invalid range query. ", valueIndexed));
String fq1 = fqs[0].equals("*") ? fqs[0] : SiteUser.staticSearchFqForClass(entityVar, searchList.getSiteRequest_(SiteRequestEnUS.class), fqs[0]);
Expand Down
Loading

0 comments on commit ba0486e

Please sign in to comment.