Search Documentation
User guide for searching in GeoHazardWatch. See User Documentation for more guides.
Quick Start
Basic Search
- Click the Search link in the navigation bar or visit
/search
- Enter your search terms in the text box
- Click Search or press Enter
- View results with relevance scores and metadata
Advanced Search
- Use the Search Options panel to access advanced features
- Combine text search with category and keyword filters
- Select specific fields to search in (titles, content, categories, keywords)
- Browse by categories or keywords without entering search terms
Search Types
1. Text Search
Search across page content, titles, and metadata using keywords or phrases.
Examples:
meeting notes - Find pages containing both words
"exact phrase" - Search for exact phrase matches
+required -excluded - Require/exclude specific terms
word* - Wildcard matching (word, words, working, etc.)
2. Category Search
Filter pages by their assigned categories. Categories are defined in page front matter.
How to use:
- Check one or more categories from the Include Categories checkbox list
- Leave search text empty to browse all pages in those categories
- Combine with text search to find specific content within a category
3. Keyword Search
Filter pages by user-defined keywords. Keywords are specified in the userKeywords field of page front matter.
How to use:
- Check one or more keywords from the Include User Keywords checkbox list
- Browse all pages tagged with specific keywords
- Combine with text and category filters for precise results
4. Advanced Multi-Criteria Search
Combine multiple search criteria for powerful filtering:
- Text + Category: Find specific content within a category
- Text + Keywords: Search for content with specific tags
- Text + Category + Keywords: Maximum precision filtering
- Category + Keywords: Browse intersection of categories and tags
Search Interface Features
Search Options Panel
The collapsible Search Options panel provides access to all search features:
- Search Text (full-width row): Main query input field
- Search In (left column): Checkboxes to limit search scope to specific fields
- Include Categories (center column): Checkboxes to filter by page categories
- Include User Keywords (right column): Checkboxes to filter by page keywords
- Search Button (full-width row): Submit the search
- Toggle: Show/hide advanced options
Search Scope Options
Control where your search looks using the Search In checkboxes:
- All Fields (default): Search across all content and metadata
- Page Titles: Search only in page titles
- Page Content: Search only in page body content
- Categories: Search within category names
- Keywords: Search within keyword tags
Results Display
Search results show comprehensive information:
- Page Title: Clickable link to the page
- Relevance Score: How well the page matches your query
- Content Snippet: Preview of matching content
- Category Badge: Page category (if assigned)
- Keyword Tags: Up to 3 keywords shown, with "+X more" indicator
- Metadata: Word count and last modified date
The sidebar provides useful information:
- Total Pages: Number of indexed pages
- Categories: Number of available categories
- Keywords: Number of available user keywords
Search Tips Panel
Built-in help shows advanced search syntax:
- Exact phrase: Use quotes
"your phrase"
- Required word: Use plus
+required
- Excluded word: Use minus
-excluded
- Wildcard: Use asterisk
word*
- Field search: Use colon
title:word
Page Organization
Categories
Categories provide high-level organization for pages. They are defined in the page front matter:
---
title: "Page Title"
category: "Documentation"
---
Best Practices:
- Use broad, descriptive categories like "Documentation", "Reference", "Tutorials"
- Keep category names consistent across pages
- Avoid too many categories - aim for 5-15 main categories
User Keywords
Keywords provide fine-grained tagging for pages. They are defined in the userKeywords field:
---
title: "Page Title"
userKeywords: ["search", "documentation", "help"]
---
Best Practices:
- Use specific, descriptive keywords
- Include both general and specific terms
- Consider synonyms users might search for
- Limit to 3-7 keywords per page for clarity
Additional tags can be specified in the tags field for even more granular organization:
---
title: "Page Title"
tags: ["search", "help", "documentation", "guide", "tutorial"]
---
Search Syntax
Basic Operators
- AND (default):
meeting notes finds pages with both terms
- OR: Use multiple searches or browse by categories/keywords
- NOT: Use minus sign
-term to exclude terms
- Required: Use plus sign
+term to require terms
Advanced Syntax
- Exact Phrases:
"search documentation" matches exact phrase
- Wildcards:
doc* matches doc, docs, documentation, etc.
- Field Search:
title:search searches only in page titles
- Boost Terms: More relevant terms naturally score higher
Fuzzy Matching
The search engine provides intelligent matching:
- Handles common typos and variations
- Stemming (search, searches, searching)
- Case-insensitive matching
- Partial word matching with wildcards
Empty Search State
When you visit the search page without parameters, you'll see:
- Browse by Category: Quick links to all available categories
- Browse by Keywords: Quick links to popular user keywords
- Search Tips: Helpful information about search syntax
- Statistics: Overview of content organization
Search Index
- Real-time: Pages are indexed when created or modified
- Metadata Extraction: Automatically extracts categories, keywords, and tags
- Boost Values: Different fields have different importance weights:
- Categories: 8x boost (highest priority)
- User Keywords: 6x boost
- Tags: 5x boost
- Keywords: 4x boost
- Content: 1x boost (baseline)
Search Speed
- Fast Results: the built-in Lunr index runs in-process on the server (not in your browser) and is held in memory, so queries return quickly
- Indexed Content: All pages pre-indexed for maximum speed
- Smart Filtering: Efficient category and keyword filtering
Search Providers
GeoHazardWatch uses a pluggable search-provider model — the active provider is chosen by the ngdpbase.search.provider setting (see Configuration Properties Reference):
- Lunr — the built-in default.
LunrSearchProvider is an in-process, server-side full-text index built with Lunr.js and persisted to disk. It needs no external service, starts with the app, and is the right choice for the large majority of instances (well into the thousands of pages).
- Elasticsearch — optional, for large/multi-node sites. The
addons/elasticsearch addon adds ElasticsearchSearchProvider for persistent, scalable, multi-node indexing — appropriate at ~10,000+ pages or when an Elasticsearch cluster is already available. Elasticsearch is built on Apache Lucene; that is where the name "Lucene" enters the picture — ngdpbase's default is Lunr, a different, lightweight library, not Lucene. An administrator switches providers via configuration; ask your administrator for details.
- Extensible. Additional providers can be created by implementing the platform's
BaseSearchProvider contract, so an instance can integrate a different search backend without changing how pages or this guide work.
Switching providers is transparent to you as a searcher — the search box, syntax, and results behave the same regardless of which provider is active.
Troubleshooting
No Results Found
If your search returns no results:
- Check Spelling: Verify search terms are spelled correctly
- Broaden Search: Try fewer or more general terms
- Remove Filters: Clear category and keyword filters
- Use Wildcards: Try
term* for partial matches
- Browse Categories: Use category links to explore content
Unexpected Results
If results don't match expectations:
- Check Search Scope: Ensure "Search In" is set to "All Fields"
- Review Filters: Clear category/keyword filters if they're too restrictive
- Use Exact Phrases: Put phrases in quotes for exact matching
- Check Page Metadata: Verify pages have correct categories/keywords
If search seems slow:
- Clear Browser Cache: Refresh the page and try again
- Simplify Query: Use fewer search terms
- Check Network: Ensure stable internet connection
Best Practices
For Content Creators
- Use Consistent Categories: Establish and follow category naming conventions
- Add Relevant Keywords: Include searchable keywords in page metadata
- Write Descriptive Titles: Use clear, searchable page titles
- Include Summaries: Add brief descriptions in page content
For Search Users
- Start Simple: Begin with basic keywords, then add filters
- Use Categories: Browse by category when exploring topics
- Combine Filters: Use multiple criteria for precise results
- Check Metadata: Look at page categories and keywords for related content
For Administrators
- Monitor Categories: Regularly review and organize categories
- Update Keywords: Keep keyword lists current and relevant
- Train Users: Provide search training for users
- Regular Maintenance: Periodically review and update page metadata
Embedding Search Results in Pages
SearchPlugin
You can embed search results directly into pages using the SearchPlugin. This is useful for creating dynamic lists and statistics.
Syntax:
[{Search query='text' system-category='category' user-keywords='keyword' format='format' max=number}]
Format Options:
- table (default): Full table with page names and relevance scores
- count: Just the count of matching pages (e.g., "13")
- titles: Bullet list of page titles with clickable links
- list: Simple list of page names without links
Examples:
Count pages by category:
Total documentation pages: [{Search system-category='documentation' format='count'}]
List all system pages:
[{Search system-category='system' format='titles'}]
Search with text query:
[{Search query='plugin' system-category='system' format='table' max=10}]
Count pages with specific keywords:
Test pages: [{Search user-keywords='test' format='count'}]
Use Cases:
- Dynamic Statistics: Show always-accurate page counts in documentation
- Related Pages Sections: Automatically list pages in a category
- Topic Indexes: Create dynamic lists of pages by keyword
- Content Discovery: Help users find related content
Example in Action:
There are currently 50 documentation pages on this platform.
All Available Plugins
Any user can embed plugins in pages. Here are all available plugins:
Fully Documented
Documentation In Progress
See GitHub Issue #163 for status
- RecentChangesPlugin - Show recent page changes
- ReferringPagesPlugin - List pages linking to current page
- SearchPlugin - Embed search results (see above for usage)
- SessionsPlugin - Display active session information
- TotalPagesPlugin - Show total page count
- UptimePlugin - Display system uptime
- VariablesPlugin - Access and display system variables
See User Keywords for the complete list of available keywords, system-category for category definitions, and Plugins for the full plugin list.