Class SearchRequest

java.lang.Object
ai.vectros.resources.search.requests.SearchRequest

public final class SearchRequest extends Object
  • Method Details

    • getQuery

      public String getQuery()
      Returns:
      The search query, expressed in natural language or as keywords. Required.
    • getMode

      public Optional<SearchRequestMode> getMode()
      Returns:
      How results are ranked. HYBRID combines semantic and keyword ranking (recommended). SEMANTIC ranks by vector similarity only. TEXT ranks by keyword matching only. Defaults to HYBRID.
    • getLimit

      public Optional<Integer> getLimit()
      Returns:
      The maximum number of results to return. Must be between 1 and 100. Defaults to 20.
    • getOffset

      public Optional<Integer> getOffset()
      Returns:
      The number of results to skip, for pagination. Must be between 0 and 200. Defaults to 0.
    • getUserId

      public Optional<String> getUserId()
      Returns:
      Restrict results to content owned by this user — the Vectros-assigned UUID of a user in your account. Use GET /v1/users?externalId= to look up a user's ID from your own identifier.
    • getOrgId

      public Optional<String> getOrgId()
      Returns:
      Restrict results to content belonging to this organization — the Vectros-assigned UUID of an organization in your account. Use GET /v1/orgs?externalId= to look up an organization's ID from your own identifier.
    • getClientId

      public Optional<String> getClientId()
      Returns:
      Restrict results to content associated with this client — the Vectros-assigned UUID of a client in your account. Use GET /v1/clients?externalId= to look up a client's ID from your own identifier.
    • getFilters

      public Optional<Map<String,FilterValue>> getFilters()
      Returns:
      Field-level filters applied to your document and record metadata. Each key is a field name, and top-level keys are AND-combined. Each value is one of: a scalar (string, number, or boolean) for an exact match; an array of scalars to match any one of them; or an operator map for ranges, negation, and membership. The supported operators are a closed set: $eq, $ne, $gt, $gte, $lt, $lte (each takes a scalar) and $in, $nin (each takes an array of scalars). Operators within one map are AND-combined, so {"price":{"$gte":100,"$lte":500}} expresses a closed range; $in and $nin may not be combined with other operators. Numbers and booleans are matched by type, so the field must have been ingested under a typed schema; dates may be sent as ISO 8601 strings or epoch milliseconds. Unknown operators, non-scalar operands, and malformed field names are rejected with a 400.
    • getTextMode

      public Optional<SearchRequestTextMode> getTextMode()
      Returns:
      How query terms are matched by the keyword engine when the mode is TEXT or HYBRID. OR matches content containing any query term (broadest recall). AND requires every term to be present (higher precision). PHRASE requires the terms to appear as a contiguous sequence. COMPLEX enables the full query syntax, including boolean operators, field-scoped queries, and range filters. When omitted, defaults to PHRASE (with a slop of 3) in HYBRID mode and OR in TEXT mode.
    • getMinSimilarity

      public Optional<Double> getMinSimilarity()
      Returns:
      The minimum semantic similarity score a result must have to be included, on a scale of 0.0 to 1.0. Results scoring below this threshold are dropped. Applies when the mode is SEMANTIC or HYBRID.
    • getMinTextRelevance

      public Optional<Double> getMinTextRelevance()
      Returns:
      A relative relevance floor for the keyword leg, given as a fraction from 0 to 1 of the TOP result's score — results scoring below (top score × this value) are dropped. Keyword scores are unbounded and depend on the query, so this is a relative cutoff rather than an absolute score: for example, 0.5 keeps only results at least half as relevant as the best hit. Applies when the mode is TEXT or HYBRID. Omit it (or use a value of 0 or less) to keep all keyword matches.
    • getSlop

      public Optional<Integer> getSlop()
      Returns:
      The phrase-match slop: the number of intervening positions allowed between query terms when textMode is PHRASE (0 means the terms must be exactly adjacent). Ignored for the other text modes.
    • getUniqueDocuments

      public Optional<Boolean> getUniqueDocuments()
      Returns:
      When true, returns at most one chunk per source item, so a single document or record cannot appear more than once in the results.
    • getContentTypes

      public Optional<List<SearchRequestContentTypesItem>> getContentTypes()
      Returns:
      Narrow results to specific content types. When omitted, empty, or set to both values, the search returns all content (documents and records) in a single unified result set, which is the default behavior. Each returned result carries a sourceType discriminator so you can tell documents and records apart. Pass ["documents"] for documents only, or ["records"] for records only.
    • getFolderId

      public Optional<String> getFolderId()
      Returns:
      Restrict results to content (documents or records) in this EXACT folder. Folders hold a mix of documents and records. Provide the Vectros-assigned UUID of a folder; use GET /v1/folders to list your folders. To match a folder AND all of its descendants, use rootFolderId instead.
    • getRootFolderId

      public Optional<String> getRootFolderId()
      Returns:
      Restrict results to content (documents or records) anywhere under this folder subtree — the folder itself and all of its descendants. Provide the Vectros-assigned UUID of a top-level (root) folder. Applies to documents and records alike. Use folderId instead to match a single exact folder.
    • getTypeName

      public Optional<String> getTypeName()
      Returns:
      Restrict results to content of a specific schema type — for example patient, intake_form, or runbook. Applies to both documents and records: any item whose bound schema type matches is kept. On its own it narrows both documents and records to that type; combine it with contentTypes to narrow within a single content type — for example contentTypes: ["documents"] with typeName: "runbook" searches only runbook documents. Untyped content (ingested without a schema) never matches a typeName filter.
    • getCreatedAfter

      public Optional<String> getCreatedAfter()
      Returns:
      Restrict results to content created at or after this ISO-8601 UTC timestamp. Useful for incremental queries (for example, finding anything ingested in the last hour), for isolating just-created content from older history, and for time-bounded analytics. Pair it with createdBefore to define a window.
    • getCreatedBefore

      public Optional<String> getCreatedBefore()
      Returns:
      Restrict results to content created at or before this ISO-8601 UTC timestamp. Pair it with createdAfter to define a window, or use it alone to find content older than a cutoff (for example, in archival or cleanup workflows).
    • getRequireComplete

      public Optional<Boolean> getRequireComplete()
      Returns:
      A fail-closed override. When true, the request returns HTTP 503 instead of partial results if one of the search engines is unavailable. Defaults to false, in which case an outage degrades to the surviving engine and the response carries degraded: true along with the failed engines in degradedLegs. Set this to true only when complete results are required and a degraded answer is unacceptable.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static SearchRequest.QueryStage builder()