Skip to content

Commit 690fcfe

Browse files
[content search] add storage data directory to ignore (open-edge-platform#2413)
1 parent ec0e302 commit 690fcfe

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

education-ai-suite/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ __pycache__/
99
storage/
1010
chroma_data/
1111
data/
12+
sqlite_db/
13+
**/local_storage/data/
1214

1315
# Ignore models directory
1416
models/

education-ai-suite/smart-classroom/content_search/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

education-ai-suite/smart-classroom/content_search/docs/dev_guide/Content_search_API.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ stateDiagram-v2
9090
Query Parameters:
9191
| Parameter | Type | Required | Default | Description |
9292
| :-------- | :------ | :------- | :------ | :-------------------------------------------------- |
93-
| `status` | string | No | None | Filter by: `QUEUED`, `PROCESSING`, `COMPLETED`, `FAILED` |
94-
| `limit` | integer | No | 100 | Max number of tasks to return (Min: 1, Max: 1000) |
93+
| `status` | `string` | No | None | Filter by: `QUEUED`, `PROCESSING`, `COMPLETED`, `FAILED` |
94+
| `limit` | `integer` | No | 100 | Max number of tasks to return (Min: 1, Max: 1000) |
9595

9696
Request:
9797
```
@@ -232,11 +232,11 @@ Response (200 OK):
232232

233233
| Field | Type | Required | Description |
234234
| :--- | :--- | :--- | :--- |
235-
| file_key | string | Yes | The full path of the file in storage (excluding bucket name). |
236-
| bucket_name | string | No | The storage bucket name. Defaults to content-search. |
237-
| prompt | string | No | Instructions for the AI (VLM). Defaults to "Please summarize this video." |
238-
| chunk_duration | integer | No | Duration of each video segment in seconds. Defaults to 30. |
239-
| meta | object | No | Custom metadata (e.g., {"tags": ["lecture"]}). Used for filtering during search. |
235+
| `file_key` | `string` | Yes | The full path of the file in storage (excluding bucket name). |
236+
| `bucket_name` | `string` | No | The storage bucket name. Defaults to content-search. |
237+
| `prompt` | `string` | No | Instructions for the AI (VLM). Defaults to "Please summarize this video." |
238+
| `chunk_duration` | `integer` | No | Duration of each video segment in seconds. Defaults to 30. |
239+
| `meta` | `object` | No | Custom metadata (e.g., {"tags": ["lecture"]}). Used for filtering during search. |
240240

241241
Request:
242242
```
@@ -311,10 +311,10 @@ A unified workflow that first saves the file to local storage and then immediate
311311

312312
| Field | Type | Required | Description |
313313
| :--- | :--- | :--- | :--- |
314-
| file | Binary | Yes | The video file to be uploaded. |
315-
| prompt | string | No | Summarization instructions (passed as a Form field). |
316-
| chunk_duration | integer | No | Segment duration in seconds (passed as a Form field). |
317-
| meta | string | No | JSON string of metadata (e.g., '{"course": "CS101"}'). |
314+
| `file` | `Binary` | Yes | The video file to be uploaded. |
315+
| `prompt` | `string` | No | Summarization instructions (passed as a Form field). |
316+
| `chunk_duration` | `integer` | No | Segment duration in seconds (passed as a Form field). |
317+
| `meta` | `string` | No | JSON string of metadata (e.g., '{"course": "CS101"}'). |
318318

319319
* Example:
320320
Request:
@@ -348,14 +348,26 @@ Executes a similarity search across vector collections using either natural lang
348348

349349
| Field | Type | Required | Description |
350350
| :--- | :--- | :--- | :--- |
351-
| query | string | Either | Natural language search query (e.g., "student at desk"). |
352-
| image_base64 | string | Either | Base64 encoded image string for visual similarity search. |
353-
| max_num_results | integer | No | Maximum number of results to return. Defaults to 10. |
354-
| filter | object | No | Metadata filters (e.g., {"run_id": "...", "tags": ["class"]}). |
351+
| `query` | `string` | Either | Natural language search query (e.g., "student at desk"). |
352+
| `image_base64` | `string` | Either | Base64 encoded image string for visual similarity search. |
353+
| `max_num_results` | `integer` | No | Maximum number of results to return. Defaults to 10. For text queries, up to `2 × max_num_results` may be returned (`top-k` from visual collection + `top-k` from document collection, merged and sorted by distance). For image queries, at most `max_num_results` are returned.|
354+
| `filter` | `object` | No | Metadata filters (e.g., {"type": ["document"], "tags": ["class"]}), detail sees below |
355+
356+
* Filter Usage Detail
357+
358+
Different filter keys are always combined with `AND`. When a filter value is a `list`, the matching logic depends on the field type:
359+
360+
| Field type | Example fields | List behavior | Operator used |
361+
| ---------- | -------------- | ------------- | ------------- |
362+
| `Array metadata` | `tags` | Matches if the stored array contains **at least one** of the filter values | `$contains` |
363+
| `Scalar metadata` | `type`, `course`, `semester` | Matches if the stored value **equals any** of the filter values | `$eq` (OR) |
364+
365+
| Note: Video-type results may appear even when "video" is not explicitly selected in the type filter, because relevant document summaries can be converted into video results during post-processing. These constructed results have "original_type": "constructed_from_summary" in their metadata to distinguish them from native video frame results.
355366

356367
* Example:
357368
Request:
358369
```
370+
# Example 1: Filter by tags — returns results whose tags array contains "classroom" or "student"
359371
curl --location 'http://127.0.0.1:9011/api/v1/object/search' \
360372
--header 'Content-Type: application/json' \
361373
--data '{
@@ -365,6 +377,16 @@ curl --location 'http://127.0.0.1:9011/api/v1/object/search' \
365377
"tags": ["classroom", "student"]
366378
}
367379
}'
380+
# Example 2: Filter by type — available values: `video`, `image`, `document`. If not specified, all types are returned. Example returns only `video` or `document` results:
381+
curl --location 'http://127.0.0.1:9011/api/v1/object/search' \
382+
--header 'Content-Type: application/json' \
383+
--data '{
384+
"query": "student in classroom",
385+
"max_num_results": 1,
386+
"filter": {
387+
"type": ["video", "document"]
388+
}
389+
}'
368390
```
369391
Response (200 OK):
370392
```json

0 commit comments

Comments
 (0)