DanRoscigno / Recipes

0 stars 0 forks source link

Fixing algolia index #22

Open DanRoscigno opened 1 week ago

DanRoscigno commented 1 week ago

The Algolia index has to have a hierarchy array, with lvl0:

hierarchy

{

lvl0: "Apple Vinaigrette"
lvl1: null
lvl2: null
lvl3: null
lvl4: null
lvl5: null
lvl6: null
}
DanRoscigno commented 1 week ago

This site uses the Algolia go client, and it has arrays of strings. check the structure: https://github.com/abtris/www.prskavec.net/blob/8b3135a9d21f9183f1dfa59d5ffcdcc652bd2698/algolia.go#L9

DanRoscigno commented 1 week ago

This is one of the search results from the working docker crawl:

{
  "content": "Spinach-Apple Salad With Maple-Cider Vinaigrette Spinach-Apple Salad With Maple-Cider Vinaigrette \n Salads   Picnic Fare   Side dish   Kim Acceptable \n Ingredients \n Sugared Curried Pecans \n 1 (6-oz.) package pecan halves \n 2 tablespoons butter, melted \n 3 tablespoons sugar \n 1/4 teaspoon ground ginger \n 1/8 teaspoon curry powder \n 1/8 teaspoon kosher salt \n 1/8 teaspoon ground red pepper \n Maple-Cider Vinaigrette \n 1/3 cup cider vinegar \n 2 tablespoons pure maple syrup \n 1 tablespoon Dijon mustard \n 1/4 teaspoon kosher salt \n 1/4 teaspoon pepper \n 2/3 cup olive oil \n Salad \n 1 (10-oz.) package fresh baby spinach, thoroughly washed \n 1 Gala apple, thinly sliced \n 1 small red onion, thinly sliced \n 1 (4-oz.) package crumbled goat cheese \n Directions \n . Prepare Pecans: Preheat oven to 350°. Toss pecans in butter. Stir together sugar and next 4 ingredients in a bowl; add pecans, tossing to coat. Spread in a single layer in a nonstick aluminum foil-lined pan. Bake 10 to 13 minutes or until lightly browned and toasted. Cool in pan on a wire rack 20 minutes; separate pecans with a fork. \n \n \n Prepare Vinaigrette: Whisk together cider vinegar and next 4 ingredients. Gradually whisk in oil until well blended. \n \n \n Prepare Salad: Combine spinach and next 3 ingredients in a bowl. Drizzle with desired amount of Maple-Cider Vinaigrette; toss to coat. Sprinkle with pecans. Serve salad with any remaining vinaigrette. \n \n \n Note: Pecans may be made up to 1 week ahead. Store in an airtight container. Vinaigrette may be made up to 3 days ahead. Cover and chill until ready to serve. \n Servings \n 8 Edit this page",
  "hierarchy": {
    "lvl0": "Spinach-Apple Salad With Maple-Cider Vinaigrette",
    "lvl1": null,
    "lvl2": null,
    "lvl3": null,
    "lvl4": null,
    "lvl5": null,
    "lvl6": null
  },
  "type": "content",
  "url": "https://danroscigno.github.io/Recipes/Spinach-Apple_Salad_With_Maple-Cider_Vinaigrette/",
  "objectID": "f274e8542058e142d125bb4d0731bccd8861532a",
  "_snippetResult": {
    "content": {
      "value": "… <mark>Vin</mark>aigrette \n 1/3 cup cider <mark>vin</mark>egar \n 2 tablespoons pure maple …",
      "matchLevel": "full"
    }
  },
  "_highlightResult": {
    "content": {
      "value": "Spinach-Apple Salad With Maple-Cider <mark>Vin</mark>aigrette Spinach-Apple Salad With Maple-Cider <mark>Vin</mark>aigrette \n Salads   Picnic Fare   Side dish   Kim Acceptable \n Ingredients \n Sugared Curried Pecans \n 1 (6-oz.) package pecan halves \n 2 tablespoons butter, melted \n 3 tablespoons sugar \n 1/4 teaspoon ground ginger \n 1/8 teaspoon curry powder \n 1/8 teaspoon kosher salt \n 1/8 teaspoon ground red pepper \n Maple-Cider <mark>Vin</mark>aigrette \n 1/3 cup cider <mark>vin</mark>egar \n 2 tablespoons pure maple syrup \n 1 tablespoon Dijon mustard \n 1/4 teaspoon kosher salt \n 1/4 teaspoon pepper \n 2/3 cup olive oil \n Salad \n 1 (10-oz.) package fresh baby spinach, thoroughly washed \n 1 Gala apple, thinly sliced \n 1 small red onion, thinly sliced \n 1 (4-oz.) package crumbled goat cheese \n Directions \n . Prepare Pecans: Preheat oven to 350°. Toss pecans in butter. Stir together sugar and next 4 ingredients in a bowl; add pecans, tossing to coat. Spread in a single layer in a nonstick aluminum foil-lined pan. Bake 10 to 13 minutes or until lightly browned and toasted. Cool in pan on a wire rack 20 minutes; separate pecans with a fork. \n \n \n Prepare <mark>Vin</mark>aigrette: Whisk together cider <mark>vin</mark>egar and next 4 ingredients. Gradually whisk in oil until well blended. \n \n \n Prepare Salad: Combine spinach and next 3 ingredients in a bowl. Drizzle with desired amount of Maple-Cider <mark>Vin</mark>aigrette; toss to coat. Sprinkle with pecans. Serve salad with any remaining <mark>vin</mark>aigrette. \n \n \n Note: Pecans may be made up to 1 week ahead. Store in an airtight container. <mark>Vin</mark>aigrette may be made up to 3 days ahead. Cover and chill until ready to serve. \n Servings \n 8 Edit this page",
      "matchLevel": "full",
      "fullyHighlighted": false,
      "matchedWords": [
        "vin"
      ]
    },
    "hierarchy": {
      "lvl0": {
        "value": "Spinach-Apple Salad With Maple-Cider <mark>Vin</mark>aigrette",
        "matchLevel": "full",
        "fullyHighlighted": false,
        "matchedWords": [
          "vin"
        ]
      }
    },
    "hierarchy_camel": [
      {
        "lvl0": {
          "value": "Spinach-Apple Salad With Maple-Cider <mark>Vin</mark>aigrette",
          "matchLevel": "full",
          "fullyHighlighted": false,
          "matchedWords": [
            "vin"
          ]
        }
      }
    ]
  }
}
DanRoscigno commented 1 week ago

This is a non-working search result (I cannot see the matches in the UI):

{
  "content": "Apple VinaigretteApple Vinaigrette\nThanksgiving Fall Salad Dressings\nIngredients:\n\n1/2 cup extra virgin olive oil\n6 tablespoons frozen organic apple juice concentrate (reseal with plastic and a rubber band and place back in freezer to avoid waste)\n4 tablespoons apple cider vinegar\n1 teaspoon Dijon mustard\n2 teaspoons  fresh lemon juice\n2 teaspoons honey\n1 pinch sea salt\n1/2 teaspoon freshly ground pepper\n\nDirections:\n\nCombine all ingredients in a bowl and whisk. Save extra dressing in covered container in the fridge for up to a week.\nEdit this page",
  "hierarchy": {
    "lvl0": "Apple Vinaigrette",
    "lvl1": "",
    "lvl2": "",
    "lvl3": "",
    "lvl4": "",
    "lvl5": "",
    "lvl6": ""
  },
  "url": "https://danroscigno.github.io/Recipes/Apple_Vinaigrette/",
  "objectID": "https://danroscigno.github.io/Recipes/Apple_Vinaigrette/",
  "_snippetResult": {
    "content": {
      "value": "Apple <mark>Vin</mark>aigretteApple <mark>Vin</mark>aigrette\nThanksgiving Fall Salad Dressings\nIngredients:\n\n1 …",
      "matchLevel": "full"
    },
    "hierarchy": {
      "lvl1": {
        "value": "",
        "matchLevel": "none"
      },
      "lvl2": {
        "value": "",
        "matchLevel": "none"
      },
      "lvl3": {
        "value": "",
        "matchLevel": "none"
      },
      "lvl4": {
        "value": "",
        "matchLevel": "none"
      },
      "lvl5": {
        "value": "",
        "matchLevel": "none"
      },
      "lvl6": {
        "value": "",
        "matchLevel": "none"
      }
    }
  },
  "_highlightResult": {
    "content": {
      "value": "Apple <mark>Vin</mark>aigretteApple <mark>Vin</mark>aigrette\nThanksgiving Fall Salad Dressings\nIngredients:\n\n1/2 cup extra virgin olive oil\n6 tablespoons frozen organic apple juice concentrate (reseal with plastic and a rubber band and place back in freezer to avoid waste)\n4 tablespoons apple cider <mark>vin</mark>egar\n1 teaspoon Dijon mustard\n2 teaspoons  fresh lemon juice\n2 teaspoons honey\n1 pinch sea salt\n1/2 teaspoon freshly ground pepper\n\nDirections:\n\nCombine all ingredients in a bowl and whisk. Save extra dressing in covered container in the fridge for up to a week.\nEdit this page",
      "matchLevel": "full",
      "fullyHighlighted": false,
      "matchedWords": [
        "vin"
      ]
    },
    "hierarchy": {
      "lvl0": {
        "value": "Apple <mark>Vin</mark>aigrette",
        "matchLevel": "full",
        "fullyHighlighted": false,
        "matchedWords": [
          "vin"
        ]
      },
      "lvl1": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      },
      "lvl2": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      },
      "lvl3": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      },
      "lvl4": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      },
      "lvl5": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      },
      "lvl6": {
        "value": "",
        "matchLevel": "none",
        "matchedWords": []
      }
    }
  }
}
DanRoscigno commented 14 hours ago

/spent 1hr