Skip to content

Commit

Permalink
Merge pull request #6 from appbaseio/fix/one-click-improvements
Browse files Browse the repository at this point in the history
One Click related improvements from the pipelines
  • Loading branch information
siddharthlatest authored Sep 11, 2023
2 parents bb70920 + 7f8d584 commit 3219f28
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 12 deletions.
4 changes: 4 additions & 0 deletions ai_answer/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"id": "auth",
"use": "authorization"
},
{
"id": "parse OpenAI API key",
"script": "function handleRequest() { if (!context.envs.OPEN_AI_API_KEY || context.envs.OPEN_AI_API_KEY == '') { return { envs: { OPEN_AI_API_KEY: context.envs.openAIConfig.open_ai_key, ...context.envs } } } }"
},
{
"id": "query",
"use": "reactivesearchQuery"
Expand Down
8 changes: 8 additions & 0 deletions cache_analytics/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
}
}
],
"global_envs": [
{
"key": "INDEX",
"value": "good-books-ds-pipeline",
"description": "Index where data will be searched",
"label": "Index"
}
],
"envs": {
"category": "reactivesearch",
"index": [
Expand Down
18 changes: 16 additions & 2 deletions indexing_pipeline/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
"description": "Index data into user-info with a location field",
"routes": [
{
"path": "/user-info/_doc",
"path": "/_indexing_example/_doc",
"method": "POST",
"classify": {
"category": "elasticsearch",
"acl": "index"
}
}
],
"global_envs": [
{
"key": "INDEX",
"value": "user-info",
"description": "Index where data will be indexed",
"label": "Index"
},
{
"key": "LOCATION_KEY",
"value": "location",
"description": "Key where the location details will be stored",
"label": "Location Key"
}
],
"stages": [
{
"id": "authorise user",
Expand All @@ -23,7 +37,7 @@
},
{
"id": "add details to body",
"script": "function handleRequest() { const requestBody = JSON.parse(context.request.body) return { request: { ...context.request, body: JSON.stringify({ ...requestBody, location: context.extractedLocation }) } } }",
"script": "function handleRequest() { const requestBody = JSON.parse(context.request.body); const locationKey = context.envs.LOCATION_KEY; if (!locationKey) locationKey = 'location'; return { request: { ...context.request, body: JSON.stringify({ ...requestBody, locationKey: context.extractedLocation }) } } }",
"needs": [
"get location details"
]
Expand Down
20 changes: 19 additions & 1 deletion knn_search/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,36 @@
"enabled": true,
"routes": [
{
"path": "/amazon_reviews/_reactivesearch",
"path": "/_knn_search/_reactivesearch",
"method": "POST",
"classify": {
"category": "reactivesearch"
}
}
],
"global_envs": [
{
"key": "INDEX",
"value": "amazon-reviews",
"description": "Index where data will be searched",
"label": "Index"
},
{
"key": "OPEN_AI_API_KEY",
"value": "",
"description": "OpenAI API Key to access their API",
"label": "OpenAI's API key"
}
],
"stages": [
{
"id": "authorize user",
"use": "authorization"
},
{
"id": "parse OpenAI API key",
"script": "function handleRequest() { if (!context.envs.OPEN_AI_API_KEY || context.envs.OPEN_AI_API_KEY == '') { return { envs: { OPEN_AI_API_KEY: context.envs.openAIConfig.open_ai_key, ...context.envs } } } }"
},
{
"id": "fetch embeddings",
"use": "openAIEmbeddings",
Expand Down
8 changes: 4 additions & 4 deletions mongodb/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@
"label": "MongoDB Host",
"key": "MONGO_HOST",
"value": "",
"description": "The mongoDB host to connect to"
"description": "The mongoDB host to connect to. Get it from https://cloud.mongodb.com/ by navigating to Deployment -> Database -> Select your Cluster -> Connect"
},
{
"label": "MongoDB Database Name",
"key": "MONGO_DB",
"value": "sample_airbnb",
"description": "The mongoDB database to connect to"
"description": "The mongoDB database to connect to. Get it from https://cloud.mongodb.com/ by navigating to Deployment -> Database -> Select your Cluster -> Connect"
},
{
"label": "MongoDB Collection",
"key": "MONGO_COLLECTION",
"value": "listingsAndReviews",
"description": "The mongoDB collection to connect to"
"description": "The mongoDB collection to connect to. Get it from https://cloud.mongodb.com/ by navigating to Deployment -> Database -> Select your Cluster -> Browse Collections"
},
{
"label": "MongoDB Credentials",
"key": "MONGO_CREDS",
"value": "",
"description": "Credentials to access the mongoDB instance"
"description": "Credentials to access the mongoDB instance. Get it from https://cloud.mongodb.com/ by navigating to Deployment -> Database -> Select your Cluster -> Connect"
}
],
"stages": [
Expand Down
12 changes: 10 additions & 2 deletions query_rules/pipeline_oneclick.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"enabled": true,
"description": "Pipeline to use query rules pre-built stages",
"description": "The pipeline applies query rules on a search index to fetch suggestions, allows parsing of user query, filter by a facet, promote results to the top.",
"routes": [
{
"path": "/good-books-ds-pipeline/_reactivesearch",
"path": "/query-rules-example",
"method": "POST",
"classify": {
"category": "reactivesearch"
}
}
],
"global_envs": [
{
"key": "INDEX",
"value": "good-books-ds-pipeline",
"description": "Index where data will be searched",
"label": "Index"
}
],
"stages": [
{
"use": "authorization",
Expand Down
24 changes: 22 additions & 2 deletions search_relevancy/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@
"best-buy-dataset"
]
},
"global_envs": [
{
"key": "INDEX",
"value": "",
"description": "Index where data will be indexed",
"label": "Index"
},
{
"key": "BOOST_SCORE_DATAFIELD",
"value": "categoryPath.name",
"description": "DataField to boost by score",
"label": "Boost By Score Datafield"
},
{
"key": "PROMOTE_RESULTS_DATAFIELD",
"value": "albumTitle",
"description": "DataField to promote results",
"label": "Promote Results Datafield"
}
],
"stages": [
{
"id": "authorization",
Expand Down Expand Up @@ -49,7 +69,7 @@
"use": "boost",
"continueOnError": false,
"inputs": {
"dataField": "categoryPath.name",
"dataField": "${{BOOST_SCORE_DATAFIELD}}",
"value": [
"cell Phones",
"Prepaid Phones"
Expand All @@ -62,7 +82,7 @@
"use": "boost",
"continueOnError": false,
"inputs": {
"dataField": "albumTitle",
"dataField": "${{PROMOTE_RESULTS_DATAFIELD}}",
"value": [
"Galaxy Note10+"
],
Expand Down
1 change: 1 addition & 0 deletions solr/pipeline_oneclick.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"enabled": true,
"description": "The Solr pipeline connects to a Solr cluster with ReactiveSearch API, enabling frontend UIs to be built using ReactiveSearch and SearchBox UI kits for React, Vue, Flutter, and JavaScript",
"routes": [
{
"path": "/_solr/_reactivesearch",
Expand Down
20 changes: 19 additions & 1 deletion vector_indexing/pipeline_oneclick.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,37 @@
"description": "Index pipeline to store vectorized data",
"routes": [
{
"path": "/amazon_reviews/_doc",
"path": "/_knn_index/_doc",
"method": "POST",
"classify": {
"category": "elasticsearch",
"acl": "index"
}
}
],
"global_envs": [
{
"key": "INDEX",
"value": "amazon-reviews",
"description": "Index where data will be indexed",
"label": "Index"
},
{
"key": "OPEN_AI_API_KEY",
"value": "",
"description": "OpenAI API Key to access their API",
"label": "OpenAI's API key"
}
],
"stages": [
{
"id": "authorize user",
"use": "authorization"
},
{
"id": "parse OpenAI API key",
"script": "function handleRequest() { if (!context.envs.OPEN_AI_API_KEY || context.envs.OPEN_AI_API_KEY == '') { return { envs: { OPEN_AI_API_KEY: context.envs.openAIConfig.open_ai_key, ...context.envs } } } }"
},
{
"id": "fetch embeddings",
"use": "openAIEmbeddingsIndex",
Expand Down

0 comments on commit 3219f28

Please sign in to comment.