FPbase icon indicating copy to clipboard operation
FPbase copied to clipboard

Add dye and microscope search to Algolia autocomplete

Open tlambert03 opened this issue 4 months ago • 0 comments

This commit closes #327 by adding dyes and microscopes to the comprehensive Algolia search bar.

Backend changes:

  • Added DyeIndex and MicroscopeIndex to proteins/index.py
  • Added url property to Dye model (links to spectra viewer)
  • Added url and owner_name properties to Microscope model
  • Updated base.html template to expose dyeIndex and microscopeIndex

Frontend changes:

  • Updated algolia.js to initialize dye and microscope indices
  • Added autocomplete sources for dyes (3 per page) and microscopes (2 per page)
  • Updated highlightHits to support manufacturer, part, slug, and owner_name fields
  • Added placeholder icon images for dye and microscope results

Dyes link to the spectra viewer (/spectra/) and microscopes link to the microscope detail page (/microscope//).

Note: Algolia indices need to be populated using Django management commands: python manage.py algolia_reindex --model Dye python manage.py algolia_reindex --model Microscope

tlambert03 avatar Nov 05 '25 16:11 tlambert03