Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
glebashnik committed Sep 27, 2024
1 parent 4759957 commit 04950bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/feed-code.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Vespa Sampleapps Search Feed
name: Vespa sample-apps code snippets search feed

on:
workflow_dispatch:
Expand All @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions feed_to_vespa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 04950bc

Please sign in to comment.