Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Sep 13, 2023
1 parent 6754f2b commit 2969024
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public class PostgresEndpoint extends Endpoint {
private String documentDate;

/** RRF * */

private int upperLimit;

private RRFWeight textWeight;

private RRFWeight similarityWeight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,14 @@ public EdgeChain<List<PostgresWordEmbeddings>> queryRRF(PostgresEndpoint postgre
val.setRawText(
Objects.nonNull(row.get("raw_text")) ? (String) row.get("raw_text") : null);

val.setFilename(
Objects.nonNull(row.get("filename"))
? (String) row.get("filename")
: null);
val.setTimestamp(
Objects.nonNull(row.get("timestamp"))
? ((Timestamp) row.get("timestamp")).toLocalDateTime()
: null);
val.setNamespace(
Objects.nonNull(row.get("namespace"))
? (String) row.get("namespace")
: null);
val.setFilename(
Objects.nonNull(row.get("filename")) ? (String) row.get("filename") : null);
val.setTimestamp(
Objects.nonNull(row.get("timestamp"))
? ((Timestamp) row.get("timestamp")).toLocalDateTime()
: null);
val.setNamespace(
Objects.nonNull(row.get("namespace")) ? (String) row.get("namespace") : null);

BigDecimal bigDecimal =
Objects.nonNull(row.get("rrf_score"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public enum OrderRRFBy {
SIMILARITY, // First Ordered by Similarity; then ordered by rrf_score; (similarity preferred, then
// relevance)
DATE_RANK; // First Ordered by date_rank; then ordered by rrf_score; (freshness preferred, then

// relevance)

public static OrderRRFBy fromString(String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ public List<Map<String, Object>> queryRRF(
dateWeight.getBaseWeight().getValue(), dateWeight.getFineTuneWeight()))
.append("FROM ( ")
.append(
"SELECT sv.id, sv.raw_text, sv.namespace, sv.filename, sv.timestamp, svtm.document_date, svtm.metadata, ")
"SELECT sv.id, sv.raw_text, sv.namespace, sv.filename, sv.timestamp,"
+ " svtm.document_date, svtm.metadata, ")
.append(
String.format(
"ts_rank_cd(sv.tsv, plainto_tsquery('%s', '%s')) AS text_rank, ",
Expand All @@ -302,7 +303,8 @@ public List<Map<String, Object>> queryRRF(
.append("FROM ")
.append(
String.format(
"(SELECT id, raw_text, embedding, tsv, namespace, filename, timestamp from %s WHERE namespace = '%s'",
"(SELECT id, raw_text, embedding, tsv, namespace, filename, timestamp from %s WHERE"
+ " namespace = '%s'",
tableName, namespace));

switch (metric) {
Expand Down

0 comments on commit 2969024

Please sign in to comment.