Perform a search

post/searches
Internal-Use Only

Perform a new search, refine a previous search, or request different visualizations of the results of a previous search.

Request Samples

1

Response Samples

1{
2 "types": [
3 "report",
4 "person",
5 "incident"
6 ],
7 "query": {
8 "type": "or",
9 "queries": [
10 {
11 "type": "text",
12 "language": "lucene",
13 "text": "John Smith"
14 },
15 {
16 "type": "object",
17 "objectIds": [
18 {
19 "type": "report",
20 "id": "SDF46AS"
21 },
22 {
23 "type": "report",
24 "id": "FN654A"
25 }
26 ]
27 }
28 ]
29 },
30 "visualizations": {
31 "results": {
32 "type": "summary",
33 "start": 1,
34 "limit": 50,
35 "hitCount": 6,
36 "order": {
37 "type": "score",
38 "direction": "descending"
39 },
40 "results": [
41 {
42 "id": "ju0RrSsRQRqdSnrKO75AFQ",
43 "type": "person",
44 "typeLabel": "Person",
45 "title": "Smith, John",
46 "attachmentsCount": 0,
47 "fields": [
48 {
49 "name": "Forename",
50 "type": "text",
51 "value": "John"
52 }
53 ],
54 "highlighting": {
55 "full_name": [
56 "<em>John</em> <em>Smith</em>"
57 ]
58 }
59 }
60 ]
61 },
62 "facets": {
63 "type": "facets",
64 "mode": "filter",
65 "facets": [
66 {
67 "objectType": "_all",
68 "facets": [
69 {
70 "type": "type",
71 "hitCount": 6,
72 "buckets": [
73 {
74 "type": "incident",
75 "hitCount": 3
76 },
77 {
78 "type": "person",
79 "hitCount": 2
80 },
81 {
82 "type": "report",
83 "hitCount": 1
84 }
85 ]
86 }
87 ]
88 },
89 {
90 "objectType": "person",
91 "facets": [
92 {
93 "type": "range",
94 "field": "age",
95 "hitCount": 2,
96 "min": 19,
97 "max": 43,
98 "ranges": [
99 {
100 "description": "<20",
101 "lt": 20,
102 "hitCount": 1
103 },
104 {
105 "description": "[20, 30)",
106 "gte": 20,
107 "lt": 30,
108 "hitCount": 0
109 },
110 {
111 "description": "[30, 40)",
112 "gte": 30,
113 "lt": 40,
114 "hitCount": 1
115 },
116 {
117 "description": ">=40",
118 "gte": 40,
119 "hitCount": 0
120 }
121 ]
122 },
123 {
124 "type": "terms",
125 "field": "gender",
126 "hitCount": 2,
127 "buckets": [
128 {
129 "term": "male",
130 "hitCount": 2
131 }
132 ]
133 }
134 ]
135 },
136 {
137 "objectType": "incident",
138 "facets": [
139 {
140 "type": "terms",
141 "field": "crime",
142 "hitCount": 3,
143 "buckets": [
144 {
145 "term": "assault",
146 "hitCount": 2
147 },
148 {
149 "term": "theft",
150 "hitCount": 1
151 }
152 ]
153 }
154 ]
155 }
156 ]
157 }
158 },
159 "errors": []
160}

Request Body

The request to /searches when performing a search including the object types to search, the query, filter, and selection criteria, as well as which visualizations to return

NameTypeRequiredDescription
version
integer
false

The representation version (3).

types
array [string]
false

The optional list of type names for the object types to be searched. If missing, all types will be searched.

query
Query or anyOf
QueryTypeAndQueryTypeCompoundQueryTypeObjectQueryTypeOrQueryTypeText
false

The different query types that can be used to search for objects. See specific query definitions for more details.

filter
Filter or oneOf
FilterTypeAndFilterTypeBoxFilterTypeDateRangeFilterTypeNotFilterTypeOrFilterTypePolygonFilterTypeQueryFilterTypeRadiusFilterTypeRangeFilterTypeTermsFilterTypeTypeFilterTypeShape
false

The different filter types that can be applied to narrow or drill down into the search results. See specific filter definitions for more details.

selection
Selection
false

The criteria by which search results are marked as selected. In order to perform certain tasks within SAS Visual Investigator, such as adding search results to a workspace or expanding nodes in a network, the search results must first be selected. Manually selecting large numbers of results can be tedious and therefore SAND allows manual selection to be combined with query-based selection (all matching objects are marked as selected) and facet-based selection (all objects matching any of the filters will be marked as selected). The filter parameter represents the facet-based selection; the include parameter represents the manual and query based selections; the exclude parameter represents the manual and query based de-selections. All parameters are optional such that selections can be made by filter only, by include query only, or by object references and compound values. Objects matching either the filter or the include parameter will be selected as long as they do not match the exclude parameter.

visualizations
object
false

The collection of visualizations to be returned. The keys supplied in this map will be used in the search response to identify the requested visualizations. See the visualization request definitions for details.

Responses

StatusMeaningDescription
200OKThe request succeeded.Schema
400Bad RequestThe request is malformed or contains invalid parameter values.Schema