Commit 68a81c8
feat: add SearchQuery schema with Lucene search examples to OpenAPI definitions
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.1 parent 2d239e3 commit 68a81c8
1 file changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
139 | 180 | | |
140 | | - | |
| 181 | + | |
141 | 182 | | |
142 | 183 | | |
143 | 184 | | |
| |||
0 commit comments