lxcprojects / keywords

Keywords for Black Louisiana document site
http://docs.k4bl.org/
Other
0 stars 3 forks source link

Search task won't index correctly #24

Closed jabrah closed 1 year ago

jabrah commented 1 year ago

The Wax search gallery expects faceted fields have their values separated by a vertical bar | but if we were to run the search task to regenerate the search index, they would be separated either by commas or semicolons. I believe this ultimately comes from the keywords.csv data. For example:

pid: d0005
label: Pedro, Maria, and Bautista Sue for Freedom
keywords: freedom suit,manumission,Indian slavery,resistance,mixed-race,kinship,race

This will produce the page _keywords/d0005.md with data snippet:

keywords: freedom suit,manumission,Indian slavery,resistance,mixed-race,kinship,race

Which then will produce this search index snippet:

{
  "pid": "d0005",
  "keywords": "freedom suit,manumission,Indian slavery,resistance,mixed-race,kinship,race",
  ...
}

Updating the original keywords.csv to change the commas in this field to |, then rerunning each of the tasks should produce "correct" data in all of the derivatives.


Recommended updates

  1. Update CSV data to use vertical bar (|) delimiter for multivalue columns instead of , or ;
  2. Remove everything in the _keywords/ folder
  3. Run bundle exec rake wax:pages keywords to generate the _keywords/ pages again
  4. Run bundle exec rake wax:search main to update the search index
jabrah commented 1 year ago

If we make those changes, we should be able to regenerate pages and search index repeatedly without any manual changes