diff --git a/.github/workflows/feed-code.yml b/.github/workflows/feed-code.yml index 77586e15a..1ae1734e4 100644 --- a/.github/workflows/feed-code.yml +++ b/.github/workflows/feed-code.yml @@ -1,4 +1,4 @@ -name: Vespa Sampleapps Search Feed +name: Vespa sample-apps code snippets search feed on: workflow_dispatch: @@ -14,7 +14,7 @@ env: VESPA_CLI_DATA_PLANE_KEY : ${{ secrets.VESPA_TEAM_VESPA_CLI_DATA_PLANE_KEY }} jobs: - build: + feed: runs-on: ubuntu-latest steps: diff --git a/feed_to_vespa.py b/feed_to_vespa.py index a5e4ec00d..67d6c6a59 100755 --- a/feed_to_vespa.py +++ b/feed_to_vespa.py @@ -6,10 +6,12 @@ import re import subprocess import sys -import yaml +import urllib.parse + import requests +import yaml from requests.adapters import HTTPAdapter, Retry -import urllib.parse + def find(json, path, separator = "."): if len(path) == 0: return json @@ -108,6 +110,8 @@ def get_feed_docids(feed, namespace, doc_type): return set(["id:{0}:term::".format(namespace) + str(find(doc, "fields.hash")) for doc in feed_json]) elif doc_type == "paragraph": return set([doc['put'] for doc in feed_json]) + elif doc_type == "code_snippet": + return set([doc['put'] for doc in feed_json]) def print_header(msg):