Skip to content

Instantly share code, notes, and snippets.

@paulsheldrake
Last active May 14, 2024 19:23
Show Gist options
  • Save paulsheldrake/5dab3927043eaba206666b2f463ef60e to your computer and use it in GitHub Desktop.
Save paulsheldrake/5dab3927043eaba206666b2f463ef60e to your computer and use it in GitHub Desktop.
{
  "objectID": "",  
  "nid": "",
  "label": "",, // String title of node
  "image": "",, // String Absolute path to image
  "entity_type": "", // String Entity type
  "root_nid": // top level index nid.   I.E.   The Austrian
  "parent_nid": // node that is referencing this item.   The Austrian vol. 9 (2023)
  "taxonomy_tags:": [
    {
      "id": "",
      "name": "", // Searchable
      "url": ""
    }
  ],
  "taxonomy_topics:": [
    {
      "id": "",
      "name": "", // Searchable
      "url": ""
    }
  ],
  "taxonomy_austrian_schools:": [
    {
      "id": "",
      "name": "", // Searchable
      "url": ""
    }
  ],
  "author: [
     {
        Name: "", // Search able
        Url: "" // Absolute link
     }
  ],
  "teaser": "", // Searchable String
  "body": "", // Searchable String,
  "publication_type": [], // Array of strings
  "mises_org_publish_date": "", // Needs to be unix timestamp,
  "print_publish_date": "",
  "url": "",, // String
  "status": boolean // is published?
  "language": "", // String,
  "publication_files": [], // Need to get absolute paths to files and make array
}

Drupal Backend

Boolean field on publications. Has sub search , makes an index in algolia

  1. its an index. sub_index_NID_node_title
  2. loop through all reference content and add it to the index. this need to be php method that takes the current node NID
  3. when content in tree updates update the index item

Frontend.

  1. use the PHP method to determine if it's in a index tree.
  2. if yes, then add details to drupalSettings on correct index the node is in
  3. search results form targets the index from drupalSettings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment