Skip to content

Commit

Permalink
feat(dia-1069): use gravity instead of opensearch for infinite discov…
Browse files Browse the repository at this point in the history
…ery (#6389)

* feat(dia-1069): use gravity instead of opensearch for infinite discovery

* add missing test

* fixes
  • Loading branch information
nickskalkin authored Jan 28, 2025
1 parent ac62560 commit ba331ab
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 378 deletions.
14 changes: 4 additions & 10 deletions _schemaV2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16879,20 +16879,17 @@ type Query {
after: String
before: String

# The number of curated artworks to return. This is a temporary field to support the transition to OpenSearch
# The number of curated artworks to return.
curatedPicksSize: Int = 2

# Exclude these artworks from the response
excludeArtworkIds: [String]
first: Int

# Which index to use to display initial batch of artworks
initialArtworksIndexName: String = "infinite_discovery_initial_artworks"
last: Int

# These artworks are used to calculate the taste profile vector. Such artworks are excluded from the response
likedArtworkIds: [String]
limit: Int
limit: Int = 5

# These fields are used for More Like This query
mltFields: [String] = ["genes", "materials", "tags", "medium"]
Expand Down Expand Up @@ -21546,20 +21543,17 @@ type Viewer {
after: String
before: String

# The number of curated artworks to return. This is a temporary field to support the transition to OpenSearch
# The number of curated artworks to return.
curatedPicksSize: Int = 2

# Exclude these artworks from the response
excludeArtworkIds: [String]
first: Int

# Which index to use to display initial batch of artworks
initialArtworksIndexName: String = "infinite_discovery_initial_artworks"
last: Int

# These artworks are used to calculate the taste profile vector. Such artworks are excluded from the response
likedArtworkIds: [String]
limit: Int
limit: Int = 5

# These fields are used for More Like This query
mltFields: [String] = ["genes", "materials", "tags", "medium"]
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"lodash": "4.17.21",
"longjohn": "0.2.12",
"marked": "2.0.1",
"mathjs": "^14.0.1",
"memcached": "2.2.2",
"moment": "2.29.4",
"moment-timezone": "0.5.37",
Expand Down
6 changes: 0 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ const {
METAPHYSICS_PRODUCTION_ENDPOINT,
METAPHYSICS_STAGING_ENDPOINT,
NODE_ENV,
OPENSEARCH_API_BASE,
OPENSEARCH_ARTWORKS_INFINITE_DISCOVERY_INDEX,
OPENSEARCH_ARTWORKS_INFINITE_DISCOVERY_CURATED_INDEX,
PORT,
POSITRON_API_BASE,
PREDICTION_ENDPOINT,
Expand Down Expand Up @@ -198,9 +195,6 @@ export default {
METAPHYSICS_STAGING_ENDPOINT,
METAPHYSICS_PRODUCTION_ENDPOINT,
NODE_ENV: NODE_ENV || "development",
OPENSEARCH_API_BASE,
OPENSEARCH_ARTWORKS_INFINITE_DISCOVERY_INDEX,
OPENSEARCH_ARTWORKS_INFINITE_DISCOVERY_CURATED_INDEX,
PORT: Number(PORT) || 3000,
POSITRON_API_BASE,
PREDICTION_ENDPOINT,
Expand Down
26 changes: 0 additions & 26 deletions src/lib/apis/opensearch.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/lib/infiniteDiscovery/calculateMeanArtworksVector.ts

This file was deleted.

127 changes: 0 additions & 127 deletions src/lib/infiniteDiscovery/findSimilarArtworks.ts

This file was deleted.

51 changes: 0 additions & 51 deletions src/lib/infiniteDiscovery/getInitialArtworksSample.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/lib/loaders/loaders_without_authentication/gravity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default (opts) => {
>(({ artwork_id, image_id }) => `artwork/${artwork_id}/image/${image_id}`),
artworkLoader: gravityLoader((id) => `artwork/${id}`),
artworksLoader: gravityLoader("artworks"),
artworksDiscoveryLoader: gravityLoader("artworks_discovery"),
authenticationStatusLoader: gravityLoader("me", {}, { headers: true }),
bidderLoader: gravityLoader((id) => `bidder/${id}`),
collectionArtworksLoader: gravityLoader(
Expand Down
Loading

0 comments on commit ba331ab

Please sign in to comment.