# Search

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Search"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/workspaces/{workspace_name}/pipelines/{pipeline_name}/search"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Run a search query using a deployed pipeline. Use this endpoint for generative,
extractive, and document search pipelines. For chat pipelines, use the Chat endpoint.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"The name of the pipeline you want to use for search.","in":"path","name":"pipeline_name","required":true,"schema":{"description":"The name of the pipeline you want to use for search.","title":"Pipeline Name","type":"string"}},{"description":"Type the name of the workspace.","in":"path","name":"workspace_name","required":true,"schema":{"description":"Type the name of the workspace.","title":"Workspace Name","type":"string"}},{"in":"query","name":"secret","required":false,"schema":{"default":"","title":"Secret","type":"string"}},{"in":"query","name":"ttl_seconds","required":false,"schema":{"default":600,"title":"Ttl Seconds","type":"integer"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"examples":[{"queries":["What is the capital of France?"]}],"properties":{"debug":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"Shows debug output for the pipeline (for example, prompt).","title":"Debug Flag"},"files":{"anyOf":[{"items":{"format":"uuid","type":"string"},"type":"array"},{"type":"null"}],"description":"A list of files in the workspace.","title":"Files"},"filters":{"anyOf":[{"properties":{"conditions":{"description":"The conditions you want to use for logical conditions.","items":{"anyOf":[{"properties":{"field":{"description":"The field you want to compare.","title":"Comparison Condition Field","type":"string"},"operator":{"description":"The operator you want to use for comparison.","title":"Comparison Condition Operator","enum":["==","!=",">",">=","<","<=","in","not in"],"type":"string"},"value":{"description":"The value you want to compare the field to.","title":"Comparison Condition Value"}},"required":["field","operator","value"],"title":"ComparisonCondition","type":"object"},"circular(LogicalCondition)"]},"title":"Conditions","type":"array"},"operator":{"description":"The operator you want to use for logical conditions.","title":"Logical Condition Operator","enum":["AND","OR","NOT"],"type":"string"}},"required":["operator","conditions"],"title":"LogicalCondition","type":"object"},{"properties":{"field":{"description":"The field you want to compare.","title":"Comparison Condition Field","type":"string"},"operator":{"description":"The operator you want to use for comparison.","title":"Comparison Condition Operator","enum":["==","!=",">",">=","<","<=","in","not in"],"type":"string"},"value":{"description":"The value you want to compare the field to.","title":"Comparison Condition Value"}},"required":["field","operator","value"],"title":"ComparisonCondition","type":"object"},{"additionalProperties":false,"properties":{},"title":"EmptyFilters","type":"object"},{"type":"null"}],"description":"Filters you can use to narrow down the search. For more information, see [filtering logic](https://docs.cloud.deepset.ai/docs/filtering-logic).","title":"Haystack Filters"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Parameters you can use to customize the pipeline. For details, see [Haystack documentation for the pipeline `run()` method](https://docs.haystack.deepset.ai/reference/pipeline-api). These filters can be used to pass additional parameters to the pipeline.(Haystack is the underlying technology for deepset.) ","title":"Pipeline Parameters"},"queries":{"description":"A list of queries you want to run through the pipeline.","items":{"type":"string"},"title":"Queries","type":"array"},"search_session_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The ID of the search session you want to use for chat.","title":"Search Session ID"},"view_prompts":{"default":false,"description":"Adds the runtime prompts of all nodes to the response. (Pipeline runs in debug mode.)","title":"View prompts","type":"boolean"}},"required":["queries"],"title":"PipelineQuery","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"properties":{"query_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"The search query.","title":"Query"},"results":{"description":"List of search results.","items":{"properties":{"_debug":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Debug"},"answers":{"default":[],"description":"List of deepset answers.","items":{"properties":{"answer":{"title":"Answer","type":"string"},"context":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"description":"Context of the answer.","title":"Context"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the document.","title":"Document ID"},"document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"description":"IDs of the document.","title":"Document IDs"},"file":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Object containing the `file_id` and `name` of a file. This is used to associate a document with a file.","title":"File Reference Object (deprecated, use `files` instead)"},"files":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"description":"List of objects containing the `file_id` and `name` of a file. This is used to associate an answer with its source files.","title":"File Reference Objects"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"The metadata of this document.","title":"Metadata of file"},"offsets_in_context":{"anyOf":[{"items":{"properties":{"end":{"description":"End of span.","title":"End","type":"integer"},"start":{"description":"Start of span.","title":"Start","type":"integer"}},"required":["start","end"],"title":"DeepsetCloudSpan","type":"object"},"type":"array"},{"items":{"properties":{"col":{"description":"Column of the answer.","title":"Column","type":"integer"},"row":{"description":"Row of the answer.","title":"Row","type":"integer"}},"required":["row","col"],"title":"DeepsetCloudTableCell","type":"object"},"type":"array"},{"type":"null"}],"description":"Offsets of the answer in the context.","title":"Offsets in Context"},"offsets_in_document":{"anyOf":[{"items":{"properties":{"end":{"description":"End of span.","title":"End","type":"integer"},"start":{"description":"Start of span.","title":"Start","type":"integer"}},"required":["start","end"],"title":"DeepsetCloudSpan","type":"object"},"type":"array"},{"items":{"properties":{"col":{"description":"Column of the answer.","title":"Column","type":"integer"},"row":{"description":"Row of the answer.","title":"Row","type":"integer"}},"required":["row","col"],"title":"DeepsetCloudTableCell","type":"object"},"type":"array"},{"type":"null"}],"description":"Offsets of the answer in the document.","title":"Offsets in Document"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The prompt that was used to generate the result.","title":"Prompt"},"result_id":{"description":"Unique identifier of the result.","format":"uuid","title":"Result ID","type":"string"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Score of the answer.","title":"Score"},"type":{"description":"Type of the answer.","enum":["generative","extractive","other"],"title":"Answer Type","type":"string"}},"required":["answer","type"],"title":"DeepsetCloudAnswer","type":"object"},"title":"Answers","type":"array"},"documents":{"default":[],"description":"List of deepset documents.","items":{"properties":{"content":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"description":"Content of the document.","title":"Content"},"embedding":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"description":"Embedding of the document.","title":"Embedding"},"file":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Object containing the `file_id` and `name` of a file. This is used to associate a document with a file.","title":"File Reference Object (deprecated, use `files` instead)"},"id":{"description":"ID of the document.","title":"Document ID","type":"string"},"meta":{"additionalProperties":true,"description":"The metadata of this document.","title":"Metadata of file","type":"object"},"result_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"description":"Unique identifier of the result.","title":"Result ID"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Shows the relevance score of the prediction.","title":"Score"}},"required":["id","meta"],"title":"DeepsetCloudDocument","type":"object"},"title":"Documents","type":"array"},"extra_outputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Additional outputs returned by the pipeline. You can specify which extra outputs you want to include using the pipeline yaml `outputs` configuration section.","title":"Extra Outputs"},"output_files":{"anyOf":[{"items":{"properties":{"file_id":{"format":"uuid","title":"File Id","type":"string"},"file_name":{"title":"File Name","type":"string"}},"required":["file_id","file_name"],"title":"OutputFile","type":"object"},"type":"array"},{"type":"null"}],"description":"Files generated by the pipeline, available for download.","title":"Output Files"},"prompts":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"description":"The prompts used in the query. This is only returned if the `view_prompts` flag is set to `true`.","title":"Prompts"},"query":{"description":"The search query.","title":"Query","type":"string"},"query_id":{"description":"Unique identifier of the search query.","format":"uuid","title":"Query ID","type":"string"}},"required":["query"],"title":"DeepsetCloudQueryResponse","type":"object"},"title":"Search Results","type":"array"}},"required":["results"],"title":"SearchResult","type":"object"}}},"description":"Returns the search results."},"400":{"description":"Invalid search response format received from the pipeline."},"403":{"description":"The shared prototype does not allow runtime parameters."},"404":{"description":"We couldn't find the pipeline. Check if the pipeline name is correct, make sure the pipeline exists in the workspace you specified, and try again."},"408":{"description":"The request sent to your pipeline timed out."},"409":{"description":"The pipeline was in a conflicted state (for example, it wasn't deployed)."},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"},"429":{"description":"The rate limit for this pipeline has been exceeded. Please try again later."},"500":{"description":"An internal error occurred while querying the pipeline."},"503":{"description":"The pipeline is temporarily unavailable because of internal rebalancing processes. Try again in a few moments."},"591":{"description":"The pipeline was on standby, and is now being activated. Try again in a while."}}}
>
  
</StatusCodes>
