# Enhanced Search

## Overview

GoFigr's Enhanced Search capabilities make finding figures across your entire research library effortless. Whether you remember a figure by its content, want to find similar visualizations, or need to locate all figures from a specific project, GoFigr's multi-modal search has you covered. Search by text, search by image, or combine both for precise results.

## Key Benefits for Users

### Find Figures Instantly

* **Text Search**: Search by figure names, descriptions, or any text content
* **Image Search**: Upload a reference image to find visually similar figures
* **Cross-Workspace**: Search across all workspaces you have access to
* **Real-Time Results**: Results appear as you type

### Discover Related Content

* **Visual Similarity**: Find figures that look alike even if named differently
* **Semantic Understanding**: Search understands meaning, not just exact matches
* **OCR-Indexed Content**: Text within figures is searchable via OCR

### Organized Results

* **Grouped by Source**: Results organized by analysis and workspace
* **Relevance Ranked**: Most relevant matches appear first
* **Figure Counts**: See how many figures match in each analysis

## Search Modes

### Text Search

Find figures by name, description, or content:

**What's Indexed:**

* Figure names and titles
* Figure descriptions
* Analysis names
* Workspace names
* Story titles and slide content
* Target audience descriptions
* Text extracted from figures via OCR

**Search Tips:**

* Use natural language: "survival curve by treatment"
* Include project names: "phase 2 trial volcano plot"
* Search for methods: "PCA dimensionality reduction"

### Image Search

Upload a reference image to find similar figures:

**How It Works:**

1. Click "Image Search" or use the upload button
2. Select or paste an image
3. GoFigr extracts visual features using deep learning
4. Finds figures with similar visual characteristics
5. Results ranked by visual similarity

**What's Compared:**

* Overall visual structure
* Color distributions
* Shape patterns
* Plot types and layouts

**Best For:**

* Finding figures you remember seeing but can't name
* Locating all variations of a plot style
* Identifying duplicates across projects
* Finding inspiration from similar visualizations

### Combined Search

Use both text and image together:

1. Enter search text to narrow by topic
2. Upload a reference image to match visually
3. Results satisfy both criteria

## Search Interface

### Search Bar

* Located in the top navigation
* Type to begin searching
* Press Enter or click search icon
* Results appear in a dedicated view

### Search Results Page

**Result Cards Show:**

* Figure thumbnail
* Figure name
* Analysis/workspace context
* Relevance score indicator
* Quick actions (view, download)

**Grouping Options:**

* By Analysis: See all matching figures per analysis
* By Workspace: Group across projects
* Flat List: All results ungrouped

**Filtering Options:**

* Workspace filter: Limit to specific workspace
* Date range: Find recent or historical figures
* Figure type: Filter by image format

## Story Search

Stories are fully searchable:

**Indexed Content:**

* Story title
* Slide content (all text)
* Target audience description
* Figure descriptions within stories

**Find Stories By:**

* Topic: "survival analysis presentation"
* Audience: "for clinical investigators"
* Content: Any text from any slide

## QR Code Detection

Image search includes QR code detection:

1. Upload an image containing a GoFigr QR code
2. QR code is detected and decoded
3. UUID extracted identifies the exact figure revision
4. Direct link to the original tracked figure

**Perfect For:**

* Tracing figures back from printed materials
* Verifying figure provenance
* Linking external references to source data

## How to Access

### Quick Search

1. Press `/` or click the search icon
2. Start typing your query
3. Press Enter to see full results

### From Home View

1. Use the search bar on the home page
2. Enter text or click image search
3. Results display inline or in full page

### From Any Page

1. Search bar is always available in navigation
2. Search context follows your current workspace
3. Results open in dedicated search view

## Search Results

### Result Information

Each result shows:

* **Thumbnail**: Visual preview
* **Name**: Figure or story title
* **Context**: Analysis → Workspace breadcrumb
* **Score**: Relevance indicator
* **Date**: Last modified timestamp

### Actions on Results

* **Click**: Open the figure/story
* **Preview**: Quick view without navigating
* **Compare**: Select multiple to compare
* **Download**: Save the figure directly

### No Results?

If your search returns nothing:

* Try broader terms
* Check spelling
* Use image search if you have a reference
* Verify workspace permissions

## Technical Details

### Search Engine

GoFigr uses OpenSearch (Elasticsearch-compatible) for:

* Full-text search with relevance ranking
* Vector similarity search for images
* Faceted filtering
* Real-time indexing

### Image Features

Visual search uses:

* VGG19-based feature extraction
* 4,096-dimensional feature vectors
* Cosine similarity matching
* Normalized for consistent scoring

### Text Analysis

Text search includes:

* Tokenization and stemming
* Fuzzy matching for typos
* Phrase matching for exact terms
* Field boosting (names weighted higher)

### OCR Integration

Text extraction from figures:

* Tesseract OCR for text detection
* Indexed alongside other metadata
* Searchable even if figure lacks description

### Indexing

Content is indexed automatically when:

* Figures are created or updated
* Stories are saved
* Documents are imported
* Metadata is edited

### Performance

* Sub-second search response times
* Scales to millions of figures
* Cached results for repeated queries
* Background indexing doesn't affect UX

## Best Practices

### For Better Search Results

1. **Name Figures Descriptively**: Better names = better search
2. **Add Descriptions**: Rich descriptions improve discoverability
3. **Use Consistent Terminology**: Standard terms help team searches
4. **Tag with Keywords**: Include relevant keywords in descriptions

### For Image Search

1. **Use Clear Reference Images**: Higher quality = better matches
2. **Crop to the Figure**: Remove surrounding content
3. **Match the Style**: Similar plot types find better matches

### Organizing for Search

1. **Consistent Naming Conventions**: Team-wide standards help everyone
2. **Analysis Organization**: Group related figures for contextual results
3. **Regular Cleanup**: Remove or archive outdated figures


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gofigr.io/features/search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
