openapi: 3.0.3
info:
  title: Shoehorn Search API
  description: |
    Full-text search across catalog entities, teams, and documentation,
    powered by Meilisearch with sub-50ms fuzzy matching.
  version: 1.0.0

servers:
  - url: https://shoehorn.example.com/api/v1
    description: Production

paths:
  /search:
    get:
      summary: Search entities
      description: Full-text search across all catalog entities using Meilisearch.
      tags: [Search]
      parameters:
        - name: q
          in: query
          required: true
          schema: { type: string }
          description: Search query (supports fuzzy matching)
        - name: type
          in: query
          schema: { type: string }
          description: Filter by entity type
        - name: lifecycle
          in: query
          schema: { type: string }
        - name: owner
          in: query
          schema: { type: string }
        - name: limit
          in: query
          schema: { type: integer, default: 20 }
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items: { $ref: '#/components/schemas/SearchResult' }
                  total: { type: integer }
                  query: { type: string }
                  processing_time_ms: { type: integer }

components:
  schemas:
    SearchResult:
      type: object
      properties:
        id: { type: string }
        service_id: { type: string }
        name: { type: string }
        type: { type: string }
        description: { type: string }
        owner: { type: string }
        lifecycle: { type: string }
        score: { type: number, description: Relevance score }
