Interface ClientSearchApi

SearchApi extension pertains to functionality related to SAS Visual Investigator's search capabilities. These additional methods are available only in the SAS Visual Investigator Investigate and Search interface.

Accessed from the window at window.sas.vi.search.

window.sas.vi.search.navigateSearch("query text", "map");
interface ClientSearchApi {
    addToNewWorkspace(objectsToAdd: ObjectIdentifier[], targetObjectType: string, targetObjectId?: string, visualization?: Visualization, workspaceName?: string, networkData?: NetworkData): Promise<void>;
    createQueryStringFromModel(queryModel: QueryBuilderModel): Promise<string>;
    getCurrentSearchQuery(): undefined | SearchQuery;
    getQueryBuilderModel(id?: string): undefined | QueryBuilderModel;
    getSelectedItems(selectionId: string, maxItems: number, textAnalytics: boolean): Promise<undefined | {
        [index: string]: SummaryVisualizationResponse;
    }>;
    navigateSearch(queryText: string, visualizationName: SearchVisualization, mapFilters?: MapFilter[], queryMode?: QueryMode[]): Promise<void>;
    openAddImageToInsightsDialog(imageData: Uint8Array, contentType: string, height?: string, width?: string): Promise<void>;
    openAddObjectsToWorkspaceDialog(visualizationName: Visualization, objects: ObjectIdentifier[], currentObject?: ObjectIdentifier, networkData?: NetworkData): Promise<void>;
    openQueryBuilderDialog(dialogTitle: string, submitButtonText?: string, queryModel?: QueryBuilderModel, enforceObjectType?: string, restrictObjectTypes?: string[]): Promise<QueryBuilderResult>;
    openSearchAndCreateDialog(wizardValues: SearchAndCreateDialogModel): Promise<SearchAndCreateDialogModel>;
    openSearchAndCreateDialog(wizardValues: SearchDialogModel): Promise<SearchDialogModel>;
    performSearch(query: SearchRepresentation): Promise<SearchResponse>;
    setQueryBuilderModel(queryModel: QueryBuilderModel, id?: string): void;
}

Hierarchy (view full)

Methods

  • Parameters

    • objectsToAdd: ObjectIdentifier[]

      {ObjectIdentifier[]} Objects to add to the workspace.

    • targetObjectType: string

      {string} Object type where the workspace is created.

    • OptionaltargetObjectId: string

      {string} Object to add to the workspace. If undefined, a new object is created.

    • Optionalvisualization: Visualization

      {"summary" | "map" | "table" | "timeline" | "networkDiagram"} Visualization to initially display in the new workspace.

    • OptionalworkspaceName: string

      {string} Name of the new workspace.

    • OptionalnetworkData: NetworkData

      {NetworkData} Network visualization data to be copied to the new workspace.

    Returns Promise<void>

    Creates a new workspace in the target object, populating it with an initial set of objects. Allows the creation of new objects assuming create mode is supported for the object type.

  • Parameters

    Returns Promise<string>

    A Promise containing the string representation of the query.

    Converts a query model generated by the query builder to a string.

  • Returns undefined | SearchQuery

    Gets the current search query if one exists. Otherwise undefined.

  • Parameters

    • Optionalid: string

      {string} ID of the model to get. Defaults to SEARCH.

    Returns undefined | QueryBuilderModel

    A query builder model.

    Gets the query builder model for the given ID. If no ID is given, it returns the query model for SEARCH.

  • Parameters

    • selectionId: string

      {string} The selection ID for the currently selected objects. Default: "SEARCH".

    • maxItems: number

      {number} The maximum number of items to get in the selection. Default: 50.

    • textAnalytics: boolean

      {boolean} Boolean value to determine whether the current visualization is Text Analytics. Default: false.

    Returns Promise<undefined | {
        [index: string]: SummaryVisualizationResponse;
    }>

    Gets the selected items within the search result or specified workspace.

  • Parameters

    • queryText: string

      {string} Text used to form the query.

    • visualizationName: SearchVisualization

      {"summary" | "map" | "table"} Visualization to query for and then display to the user.

    • OptionalmapFilters: MapFilter[]

      {MapFilter[]} The map filter object to include with the search query. This can consist of MapBoundedPolygonFilter, MapRadiusFilter, MapBoundedBoxFilter or MapShapeFilter.

    • OptionalqueryMode: QueryMode[]

      {"standard" | "phonetic" | "synonym"} Used to perform phonetic and synonym searches. Default: "standard".

    Returns Promise<void>

    Performs a search against the svi-sand service and navigates the user to the Search Results page.

  • Parameters

    • imageData: Uint8Array

      {Uint8Array} Image to add.

    • contentType: string

      {string} This is used in the content-type header when the file is uploaded. For example 'image/png'.

    • Optionalheight: string

      {string} Height of the Insights cell.

    • Optionalwidth: string

      {string} Width of the Insights cell.

    Returns Promise<void>

    Adds an image to the Insights selected in the "Add image to Insights" dialog.

  • Parameters

    • visualizationName: Visualization

      {Visualization} Visualization to display after the objects have been added.

    • objects: ObjectIdentifier[]

      {ObjectIdentifier[]} Objects to add to the workspace.

    • OptionalcurrentObject: ObjectIdentifier

      {ObjectIdentifier} The document the user is currently viewing. This is used as a visual aid in the dialog box.

    • OptionalnetworkData: NetworkData

      {NetworkData} Network visualization data to be copied to the workspace.

    Returns Promise<void>

    Opens the "Add Objects to Workspace" dialog box and then performs the action after a document and workspace have been selected.

  • Parameters

    • dialogTitle: string

      {string} Title of the dialog.

    • OptionalsubmitButtonText: string

      {string} Text for the dialog box submit button.

    • OptionalqueryModel: QueryBuilderModel

      {QueryBuilderModel} An existing query model that can be used to initially populate the query builder.

    • OptionalenforceObjectType: string

      {string} If enforceObjectType is set, the user cannot choose which entity to query. It is pre-set to the specified entity.

    • OptionalrestrictObjectTypes: string[]

      {Array} If restrictObjectTypes is set, then the entity dropdown is filtered to show only the entities in this list.

    Returns Promise<QueryBuilderResult>

    A Promise containing the result of the dialog box.

    Opens the query builder dialog box allowing the user to create a new query or edit an existing one passed in via the query model parameter.

    const searchApi: SearchApi = window.sas.vi.search;
    const dialogTitle = 'Intelligence Search'
    const submitButtonText = 'Submit'
    const objectType = 'intel'

    searchApi.openQueryBuilderDialog(dialogTitle, submitButtonText, undefined, objectType).then( (query) => {
    // Perform query action
    })
  • Parameters

    Returns Promise<SearchAndCreateDialogModel>

    A Promise which resolves when the dialog box is closed.

    Launches a wizard allowing users to search, before creating an object/relationship. The relationship wizard is determined by the relateToParentLabel or relateToParentName defined in the wizardValues parameter.

  • Parameters

    • wizardValues: SearchDialogModel

      {SearchDialogModel} Object containing entity and relationship data.

    Returns Promise<SearchDialogModel>

    A Promise which resolves when the dialog box is closed.

    Launches a wizard allowing users to search, before creating an object/relationship. The relationship wizard is determined by the relateToParentLabel or relateToParentName defined in the wizardValues parameter.

  • Parameters

    • query: SearchRepresentation

      {SearchRepresentation} Query to send to the service.

    Returns Promise<SearchResponse>

    A Promise containing the search response.

    Performs a search against the svi-sand service.

  • Parameters

    • queryModel: QueryBuilderModel

      {QueryBuilderModel} A query builder model.

    • Optionalid: string

      {string} ID of the model to set. Default: SEARCH.

    Returns void

    Sets the query builder model for the given ID. If no ID is given, it sets the query model for SEARCH. When stored, the query model is used to initially populate a Query Builder opened with the given ID.