feat: add comprehensive Lucene search query examples to OpenAPI definitions#7
Merged
Lutherwaves merged 1 commit intomainfrom Jan 1, 2026
Merged
Conversation
c1ac09d to
bafbb31
Compare
…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.
bafbb31 to
a0c75dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added 34 search query examples to types/types.go covering all Lucene search capabilities:
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.