Implementation:Infiniflow Ragflow SearchService Save
Appearance
| Knowledge Sources | |
|---|---|
| Domains | RAG, Search |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Concrete tool for creating search application records provided by RAGFlow SearchService.
Description
SearchService.save creates a new Search record via the POST /search/create endpoint. The endpoint validates the name and auto-sets tenant_id, created_by, and timestamps.
Usage
Called via REST API to create a new search application.
Code Reference
Source Location
- Repository: ragflow
- File: api/apps/search_app.py (L30-61), api/db/services/search_service.py (L29-39)
Signature
@manager.route('/create', methods=['POST'])
@login_required
async def create():
"""Create a search application.
Body: {name: str, description?: str}
Returns: {search_id: str}
"""
class SearchService(CommonService):
model = Search
# save(**kwargs) inherited from CommonService
Import
from api.db.services.search_service import SearchService
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | Search application name |
| description | str | No | Description |
Outputs
| Name | Type | Description |
|---|---|---|
| search_id | str | Created search application ID |
Usage Examples
import requests
url = "http://localhost:9380/search/create"
payload = {"name": "Product Search"}
response = requests.post(url, json=payload, headers=headers)
search_id = response.json()["data"]["search_id"]
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment