Class SearchRequest
java.lang.Object
ai.vectros.resources.search.requests.SearchRequest
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classstatic interface -
Method Summary
-
Method Details
-
getQuery
- Returns:
- The search query, expressed in natural language or as keywords. Required.
-
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
- Returns:
- The maximum number of results to return. Must be between 1 and 100. Defaults to 20.
-
getOffset
- Returns:
- The number of results to skip, for pagination. Must be between 0 and 200. Defaults to 0.
-
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.
-
getScope
- Returns:
- Restrict results to content carrying this scope value, in
namespace:valueform (a value is 1-128 chars: a letter or digit first, then letters, digits,_or-) — for examplegroup:eng-team,org:<id>, orclient:<id>. Scope values are attached to records and documents at creation (thescopesfield). UseGET /v1/entities/{namespace}?externalId=to look up an entity's ID from your own identifier.
-
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;$inand$ninmay 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
- 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
- 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
- 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
- Returns:
- The phrase-match slop: the number of intervening positions allowed between query terms when
textModeis PHRASE (0 means the terms must be exactly adjacent). Ignored for the other text modes.
-
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
- 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
sourceTypediscriminator so you can tell documents and records apart. Pass["documents"]for documents only, or["records"]for records only.
-
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/foldersto list your folders. To match a folder AND all of its descendants, userootFolderIdinstead.
-
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
folderIdinstead to match a single exact folder.
-
getTypeName
- Returns:
- Restrict results to content of a specific schema type — for example
patient,intake_form, orrunbook. 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 withcontentTypesto narrow within a single content type — for examplecontentTypes: ["documents"]withtypeName: "runbook"searches only runbook documents. Untyped content (ingested without a schema) never matches atypeNamefilter.
-
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
createdBeforeto define a window.
-
getCreatedBefore
- Returns:
- Restrict results to content created at or before this ISO-8601 UTC timestamp. Pair it with
createdAfterto define a window, or use it alone to find content older than a cutoff (for example, in archival or cleanup workflows).
-
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: truealong with the failed engines indegradedLegs. Set this to true only when complete results are required and a degraded answer is unacceptable.
-
equals
-
getAdditionalProperties
-
hashCode
public int hashCode() -
toString
-
builder
-