> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # SearchService > HTTP API service for serving search queries with authentication and caching. [searchengine]: /docs/server-sdks/reference/python/agents/search/search-engine [start]: /docs/server-sdks/reference/python/agents/search/search-service/start [searchdirect]: /docs/server-sdks/reference/python/agents/search/search-service/search-direct [stop]: /docs/server-sdks/reference/python/agents/search/search-service/stop `SearchService` wraps one or more search indexes behind a FastAPI HTTP service with basic authentication, CORS, query caching, and optional HTTPS support. It can serve both SQLite and pgvector backends simultaneously. ```python from signalwire.search import SearchService ``` > **Warning** > > Requires FastAPI and uvicorn in addition to search dependencies: > `pip install signalwire-sdk[search]`. ## **Properties** **`app`** `FastAPI | None` — default: None The FastAPI application instance. `None` if FastAPI is not installed. --- **`indexes`** `dict[str, str]` Mapping of index names to file paths (SQLite) or collection names (pgvector). --- **`search_engines`** `dict[str, SearchEngine]` Mapping of index names to loaded [`SearchEngine`][searchengine] instances. --- **`backend`** `str` Storage backend in use. `"sqlite"` or `"pgvector"`. --- **`port`** `int` Port the service listens on. --- ## **Methods** #### [start](/docs/server-sdks/reference/python/agents/search/search-service/start) Start the HTTP service. Blocks until the server is shut down. #### [search\_direct](/docs/server-sdks/reference/python/agents/search/search-service/search-direct) Perform a search programmatically without going through the HTTP API. #### [stop](/docs/server-sdks/reference/python/agents/search/search-service/stop) Stop the service and perform cleanup. ## **HTTP Endpoints** When running, the service exposes the following endpoints: | Endpoint | Method | Auth | Description | | --------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------- | | `/search` | POST | Required | Submit a search query. Request body accepts `query`, `index_name`, `count`, `similarity_threshold`, `tags`, and `language`. | | `/health` | GET | None | Health check. Returns backend type, loaded indexes, and SSL status. | | `/reload_index` | POST | Required | Reload or add a new index at runtime. | > HTTP API service for serving search queries with authentication and caching. ## Docs - [search_direct](https://signalwire.com/docs/server-sdks/reference/python/agents/search/search-service/search-direct.md): Perform a search programmatically without going through the HTTP API. - [start](https://signalwire.com/docs/server-sdks/reference/python/agents/search/search-service/start.md): Start the HTTP search service. - [stop](https://signalwire.com/docs/server-sdks/reference/python/agents/search/search-service/stop.md): Placeholder for stopping the search service (not yet implemented).