Welcome to the Jose Madrid Salsa developer docs — explore features, APIs, and deployment guides.
Jose Madrid SalsaJMS Docs

Search Configuration

Product and content search using PostgreSQL full-text capabilities

Search Configuration

Jose Madrid Salsa uses PostgreSQL-based search through Prisma queries rather than an external search service like Algolia or Meilisearch.

Search Architecture

Product search is implemented directly against the PostgreSQL database using Prisma's contains and field filtering. The Product model includes a searchKeywords field for enhanced discoverability:

prisma/schema.prisma
model Product {
  name           String
  slug           String    @unique
  description    String?
  ingredients    String[]
  searchKeywords String[]   // Additional search terms
  // ...
}

Search Fields

When searching for products, the application typically queries across:

FieldTypeSearch Method
nameStringCase-insensitive contains
descriptionStringCase-insensitive contains
ingredientsString[]Array contains
searchKeywordsString[]Array contains
skuStringExact match
slugStringContains

Category and Tag Filtering

Products can be filtered through relationships:

model Category {
  id   String @id @default(cuid())
  name String @unique
  slug String @unique
  // products Product[]
}

model ProductTag {
  productId String
  tagId     String
  @@unique([productId, tagId])
}

Heat Level Filtering

Salsa-specific filtering by heat level:

enum HeatLevel {
  MILD
  MEDIUM
  HOT
  EXTRA_HOT
}

Stock Status Filtering

Products include stock status with a dedicated index:

model Product {
  stockStatus StockStatus @default(IN_STOCK)
  @@index([stockStatus])
}

enum StockStatus {
  IN_STOCK
  LOW_STOCK
  OUT_OF_STOCK
  DISCONTINUED
}

Recipes are searchable by title, category, and tags:

model Recipe {
  title       String @unique
  slug        String @unique
  description String
  category    String
  difficulty  String
  ingredients String[]
}

The retail locations feature uses Google Places API for geographic search, configured via:

.env.local
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="your-key"
GOOGLE_PLACES_API_KEY="your-key"

The application does not use a dedicated search engine. All search queries go directly to PostgreSQL via Prisma. For high-traffic scenarios, consider adding PostgreSQL full-text search indexes or an external search service.

Database Indexes

Key indexes that support search performance:

model Product {
  @@index([stockStatus])
}

model Category {
  // name and slug are @unique (implicitly indexed)
}

model Tag {
  slug String @unique
  @@index([type])
}

How is this guide?

Edit on GitHub

Last updated on

On this page