Skip to content

Comments

feat: add comprehensive Lucene search query examples to OpenAPI definitions#7

Merged
Lutherwaves merged 1 commit intomainfrom
claude/add-search-examples-gWHQk
Jan 1, 2026
Merged

feat: add comprehensive Lucene search query examples to OpenAPI definitions#7
Lutherwaves merged 1 commit intomainfrom
claude/add-search-examples-gWHQk

Conversation

@Lutherwaves
Copy link
Owner

Added 34 search query examples to types/types.go covering all Lucene search capabilities:

  • Basic field search (exact match, wildcards)
  • Boolean operators (AND, OR, NOT)
  • Required/Prohibited operators (+, -)
  • Range queries (inclusive, exclusive, open-ended, date ranges)
  • Quoted phrases and special characters
  • Complex nested queries
  • Implicit search across all string fields
  • JSONB/nested field access with dot notation
  • Null value queries
  • Fuzzy search with edit distance

These examples can be referenced in Swagger annotations using:
$ref: "#/components/examples/SearchQueryBasic"
$ref: "#/components/examples/SearchQueryWildcard"
etc.

This allows API consumers to easily understand and use the Lucene query syntax
for filtering and searching resources, similar to how PatchBody provides examples
for PATCH operations.

Related to PR tink3rlabs#124 which added Lucene search support.

@Lutherwaves Lutherwaves force-pushed the claude/add-search-examples-gWHQk branch from c1ac09d to bafbb31 Compare December 31, 2025 23:55
…efinitions

Added SearchQuery schema to types/types.go with 34 comprehensive examples
covering all Lucene search capabilities:

Schema Structure:
- Type: string
- Description: Full Lucene query syntax reference
- Default example: "name:john AND status:active"
- 34 example queries covering:
  * Basic field searches and wildcards
  * Boolean operators (AND, OR, NOT, +, -)
  * Range queries (inclusive, exclusive, open-ended, dates)
  * Quoted phrases and escaped characters
  * Complex nested queries
  * Implicit search across string fields
  * JSONB/nested field access (field.subfield:value)
  * Null value queries (field:null)
  * Fuzzy search (term~, term~2)

Usage in Swagger/OpenAPI annotations:
  schema:
    $ref: "#/components/schemas/SearchQuery"

Or in Go swaggo annotations:
  // @param query query string false "Search query" SchemaExample(SearchQuery)

This provides a reusable schema definition similar to PatchBody, making it
easy for API consumers to understand and use Lucene query syntax for filtering
and searching resources.

Related to PR tink3rlabs#124 which added Lucene search support.
@Lutherwaves Lutherwaves force-pushed the claude/add-search-examples-gWHQk branch from bafbb31 to a0c75dc Compare January 1, 2026 00:03
@Lutherwaves Lutherwaves merged commit 68a81c8 into main Jan 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants