projectEndings / staticSearch

A codebase to support a pure JSON search engine requiring no backend for any XHTML5 document collection
https://endings.uvic.ca/staticSearch/docs/index.html
Mozilla Public License 2.0
46 stars 21 forks source link

Remove unused attributes and JSON values #240

Closed martindholmes closed 2 years ago

martindholmes commented 2 years ago

We have some relics of earlier processing or plans in our codebase which (we believe) can be removed without fallout:

  1. We pointlessly construct an @id attribute for HTML documents which don't have one during the tokenize stage. For the purposes of document identity, we use the URI relative to the search page, but at some stage we presumably used or considered using the @id attribute on the <html> element, and we therefore construct one if there isn't one. That code can go (it's in the template matching html in the clean mode).

  2. We pointlessly output that docId into the JSON stem files, which makes them slightly bigger. That can go from the makeMap template.

  3. We have a method of the StaticSearch object called StaticSearch~getDocIdsForFilters(), but it's not using document ids; it's using the docUri relative paths that we adopted as identifiers. It should be renamed to avoid confusion to StaticSearch~getDocUrisForFilters().

martindholmes commented 2 years ago

Working on this in branch issue-240-nuke-docId.

martindholmes commented 2 years ago

Ready for a PR now.

martindholmes commented 2 years ago

PR merged, so closing this.