Full-Text Search REST API
Full-text indexing and search is supported by Opensearch. In the local development environment, you can access the Opensearch server at https://localhost:9200.
Index
When you execute the reindex action, all objects with supported data types that have the Text Search flag enabled are indexed.
Supported Data Types
Max Data Type
|
Mapping Opensearch Data Type
|
Boolean
|
Boolean
|
• date
• time
• timestamp
|
Date
|
• number
• percent
• rollup
|
Double
|
Integer
|
Long
|
• address
• code
• content
• currency_amount
• dynamic_relationship
• email
• identifier
• option_list
• quantity
• phone_number
• relationship
• status
• string
• string_localized
• text
• text_localized
• url
|
Text
|
uuid
|
Keyword
|
location
|
geo_point
|
Index Structure
Opensearch has no strict constraint between types and fields. Multiple fields with identical names must have the same data type. Because field full identifiers cannot be used as index field names, be sure to use record UUIDs for indexing.
Max Data Type
|
Opensearch Field Name
|
Description
|
|
id
|
The record UUID.
|
|
name
|
The record’s primary name.
|
|
content
|
All indexed field values exclude records’ UUIDs and primary names.
|
• option_list
• relationship
• dynamic_relationship
|
• Record UUID
• _Record UUID
|
Record UUID is the readable text value. When prepended with an underscore, this is the actual value in the database. Following is an example Record UUID value for a dynamic relationship for the Showcase object:
"0cd6c065-5648-4f38-b7e4-af1f3c267993":"System Administrator"
Following is an example _Record UUID value for the same relationship and object:
"_0cd6c065-5648-4f38-b7e4-af1f3c267993":["764f0869-8b2a-4e43-8f23-88f593863eff","8b283436-18f9-3cb7-a1f8-2d330fe154cf"]
|
All other supported data types except:
• option_list
• relationship
• dynamic_relationship
|
Record UUID
|
|
|
Opensearch fields that start with underscores are for storage purposes, are not indexed, and cannot be searched.
|
Useful Index URLs
• To execute reindexing:
https://<hostname>/search/indexer?index_action=reindex
• To check full-text reindexing status:
https://<hostname>/<instance>/check_indexing_status
Search
Search queries with the Opensearch DSL and the auto-complete search filter are currently supported. For more information, see
https://opensearch.org/docs/latest/query-dsl.html.
The search URL is /search.
Search Parameters
Parameter
|
Description
|
q
|
The text of the query. Can be set as a single url parameter.
|
type
|
The type of objects to search. Multiple types can be specified in a comma-separated list. Can be set as a single url parameter.
|
_source
|
The result fields expected from the specified search options. Must be specified as field UUIDs. Multiple fields can be specified in a comma-separated list. Can be set as a single url parameter.
|
order_by
|
The field by which to order results, specified as a field UUID. In the current implementation, this value must be in the _source parameter. Can be set as a single url parameter.
|
order_option
|
For order_by, you can set asc or desc. If not specified, asc is the default. Can be set as a single url parameter.
|
size
|
The number of records to return. If not specified, 25 records are returned by default. Can be set as a single url parameter.
|
include_inactive
|
Whether to return inactive records. Values are true or false. Can be set as a single url parameter.
|
include_deleted
|
Whether to return deleted records. Values are true or false. Can be set as a single url parameter.
|
search_attachment
|
Whether to search attachments. Values are true or false. Can be set as a single url parameter.
|
attach_objects
|
Object UUIDs by which to limit search scope. For example, to search attachments to Task records, specify "db13a9ad-2494-34bb-8a59-cb99fd308051" (the Task object UUID). Multiple object UUIDs separated with commas can be specified.
|
query
|
A JSON string that specifies the Opensearch DSL.
|
search_filter
|
|
|
If the same parameter is in the URL and the request body, the URL parameter value takes priority.
|
Search Examples
• Globally query servicemax:
POST https://localhost:8080/search?q=servicemax
• Query the text showcase in records of an object:
|
In this sample, the UUID value for the target object is 016e5041-d28e-32b2-b2ac-2db3f1406411.
|
POST https://localhost:8080/search?q=showcase&type=016e5041-d28e-32b2-b2ac-2db3f1406411
To return the first 5 records found with the text showcase:
POST https://localhost:8080/search?q=servicemax&type=016e5041-d28e-32b2-b2ac-2db3f1406411&size=5
• Query the text developer in an object and the User object:
POST https://localhost:8080/search?q=developer&type=016e5041-d28e-32b2-b2ac-2db3f1406411,8b283436-18f9-3cb7-a1f8-2d330fe154cf&size=10
• Return only the name or username field:
POST https://localhost:8080/search?q=developer&type=016e5041-d28e-32b2-b2ac-2db3f1406411,8b283436-18f9-3cb7-a1f8-2d330fe154cf&size=10&_source=c74f2dd8-b910-11e0-87b3-00ff79122e2e,d77220e1-0617-429e-a7cc-3b0fea9b5e06
• Query the _all field:
POST https://localhost:8080/search?type=016e5041-d28e-32b2-b2ac-2db3f1406411,8b283436-18f9-3cb7-a1f8-2d330fe154cf&size=10
{
"query": {
"match": {
"_all": "servicemax"
}
}
}
• Query a specific field:
POST https://localhost:8080/search?type=8b283436-18f9-3cb7-a1f8-2d330fe154cf
{
"query": {
"match": {
"d77220e1-0617-429e-a7cc-3b0fea9b5e06": "system"
}
}
}
• Query a specific field with exact matching:
POST http://localhost:8080/search?type=8b283436-18f9-3cb7-a1f8-2d330fe154cf
{
"query": {
"match": {
"d77220e1-0617-429e-a7cc-3b0fea9b5e06": "system"
}
}
}
• Query multiple objects and multiple fields:
POST https://localhost:8080/search?type=016e5041-d28e-32b2-b2ac-2db3f1406411,8b283436-18f9-3cb7-a1f8-2d330fe154cf
{
"query" : {
"bool" : {
"should" : [
{
"match" : {
"d77220e1-0617-429e-a7cc-3b0fea9b5e06": "system"
}
},
{
"match" : {
"c74f2dd8-b910-11e0-87b3-00ff79122e2e": "showcase"
}
}
]
}}
}
• Search with search_filter together and specify all parameters in the request body:
POST https://localhost:8080/search
{
"type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_source": "c74f2dd8-b910-11e0-87b3-00ff79122e2e",
"order_by": "c74f2dd8-b910-11e0-87b3-00ff79122e2e",
"order_option": "desc",
"query": {
"match": {
"c74f2dd8-b910-11e0-87b3-00ff79122e2e": "business"
}
},
"search_filter": [
{
"clause": "io_name is not null"
}
]
}
• Search for field objects with matching Short Description and Datatype values and an Identifier field value of identifier:
POST https://localhost:8080/search
{
"type": "18a79edb-06b0-32ef-a3ae-42bc00dc98a0",
"_source": "c73849e2-b910-11e0-87b3-00ff79122e2e,78f92a42-0228-419f-b455-601c4fff85e6",
"query": {
"match": {
"78f92a42-0228-419f-b455-601c4fff85e6": "Datatype"
}
},
"search_filter": [
{
"object": "18a79edb-06b0-32ef-a3ae-42bc00dc98a0",
"connector": "AND",
"type": "object",
"rules": [
{
"field": "6c47ea42-b910-11e0-9a37-00ff79122e2e",
"operator": "equal",
"value": [
{
"value": "identifier",
"type": "value"
}
],
"type": "rule"
}
]
}
]
}
• Return fields with many different data types:
POST https://localhost:8080/search
{
"type": "294ae5eb-952b-467e-a2fc-d27751221d2a",
"_source": "50be4c40-d099-45e2-a45d-269c70f7a979,6a0d41f8-942d-40ca-bd59-d006a804d52a,9a441b46-4850-4345-8b2a-23df655a8612,5d1ed041-9ea6-4962-a80a-d1432ec6a527,e80c5419-7b89-41c0-a223-448c5f0ed1bf,117f2e36-0756-4652-816b-d8ed175d9628,eca64d35-2338-4445-b87d-07597bcf4bbb,c32e2b7d-9f14-48e1-b9d7-a67c3301bda7,503afcc9-f978-4f99-a835-4025e52e149a,4ca4801a-6b15-491e-87c7-27e8f088b28c,17ff7527-f11c-4f27-98dc-73d729550969,bd81be5b-aa4a-4aa7-a889-bb5c07673dd7,854ab534-2511-4404-bf19-c74ab80ae91e,0cd6c065-5648-4f38-b7e4-af1f3c267993",
"query": {
"match": {
"0cd6c065-5648-4f38-b7e4-af1f3c267993": "system"
}
},
"search_filter": [
{
"object": "294ae5eb-952b-467e-a2fc-d27751221d2a",
"connector": "AND",
"type": "object",
"rules": [
{
"field": "8b9f108c-a1a2-4623-955c-647cd5f978b1",
"operator": "is_not_null",
"value": null,
"type": "rule"
}
]
}
]
}
• Query by the UUID of the related record:
|
This example queries for records of the Showcase object with the Showcase Dynamic Relationship field set to the Standard User role.
|
POST https://localhost:8080/search
{
"type": "294ae5eb-952b-467e-a2fc-d27751221d2a",
"query": {
"match": {
"_0cd6c065-5648-4f38-b7e4-af1f3c267993": "91504adf-2564-49c7-a612-9956b796b5a2"
}
}
}
• Query with request highlighting:
POST https://localhost:8080/search
{
"type": "71b7ae3e-b21e-11e0-90ab-001ec93afa2c",
"query": {
"bool": {
"should": [
{
"wildcard": {
"7d04de0d-af8b-4ec1-9261-b6d404fcf638": {
"value": "*bpm*"
}
}
},
{
"wildcard": {
"7203f9ba-b21e-11e0-90ab-001ec93afa2c": {
"value": "*bpm*"
}
}
}
]
}
},
"highlight": {
"fields": {
"*": {
"fragment_size": 50,
"number_of_fragments": 3
}
},
"require_field_match": false
}
}
Sample Returned Results
[
{
"highlight": {
"io_name": [
"Max <em>BPM</em>"
],
"name": [
"Max <em>BPM</em>"
],
"io_identifier": [
"<em>bpm</em>"
],
"io_description": [
"Max <em>BPM</em> – Business Process Management. This is"
]
},
"_object_name": "Application",
"_record": "6c2e57e1-0bfe-4261-8da3-64d076db9b1e",
"_record_name": "Max BPM",
"_score": "2.0",
"_object": "71b7ae3e-b21e-11e0-90ab-001ec93afa2c"
},
{
"highlight": {
"io_application": [
"Max <em>BPM</em>"
],
"io_description": [
" the processes in Max <em>BPM</em> use. This logic, also"
]
},
"_object_name": "Application",
"_record": "ae5a99b2-b7c8-4bbc-90d2-dfca254d67a7",
"_record_name": "Max BRM",
"_score": "1.0",
"_object": "71b7ae3e-b21e-11e0-90ab-001ec93afa2c"
}
]
• Query with auto_complete client:
GET http://localhost:8080/search?q=business&client=auto_complete&type=016e5041-d28e-32b2-b2ac-2db3f1406411
• Query on application scope type:
|
In this sample, 7a4979b5-ceb1-47a9-842b-7c761748fbc5 represents the UUID for the Max Designer application.
|
GET http://localhost:8080/search?q=business&type=7a4979b5-ceb1-47a9-842b-7c761748fbc5&scope_type=application
• Query on an uploaded attachment:
You can find attachment filenames by using the Search All option on the Networktab of the Developer Tools pane in Google Chrome to generate a POST request. Check the response for the filename and send the following request:
POST https://<hostname>search
{
"include_inactive": true,
"q": "test.txt",
"_source": "78f92a42-0228-419f-b455-601c4fff85e6,1389724a-537d-4c76-8203-6e94f0c48129,584b3176-1db6-4bd3-aa4a-2cf7de65838c,117f2e36-0756-4652-816b-d8ed175d9628,8620ee14-5611-4722-842d-84f4354c67dc",
"search_fields": "id,name:50,content",
"scope_type": ""
}
Sample Returned Results
The following sample results include multiple existing files with the same filename because no filters were specified in the request body.
[
{
"_io_updated_by": "764f0869-8b2a-4e43-8f23-88f593863eff",
"io_updated_by": "System Administrator",
"_object_name": "Document",
"io_owner": "System Administrator",
"_record": "db2f0f15-1d96-46d2-a0d8-978ce973b57f",
"_record_name": "file.pdf",
"io_updated_on": "2017-11-20T06:56:50.174Z",
"_score": "682.2858",
"io_active": true,
"_io_owner": "764f0869-8b2a-4e43-8f23-88f593863eff",
"_object": "6875c504-b21e-11e0-90ab-001ec93afa2c"
},
{
"_io_updated_by": "764f0869-8b2a-4e43-8f23-88f593863eff",
"io_updated_by": "System Administrator",
"_object_name": "Version",
"io_owner": "System Administrator",
"_record": "2dfc8ee2-4868-4485-bba4-d7a7400a89ba",
"_record_name": "file.pdf",
"io_updated_on": "2017-11-20T06:56:50.174Z",
"_score": "682.2858",
"io_active": true,
"_io_owner": "764f0869-8b2a-4e43-8f23-88f593863eff",
"_object": "6bd99fd6-b21e-11e0-90ab-001ec93afa2c"
},
{
"_object_name": "Version",
"_record": "676ba4ca-582e-4b29-8bfb-cba291cfcc58",
"_record_name": "test.txt",
"doc_type": "f",
"_score": "15.217022",
"io_active": true,
"_object": "6bd99fd6-b21e-11e0-90ab-001ec93afa2c"
}
]
• Search with output_context:
GET http://localhost:8080/search?q=bpm&type=016e5041-d28e-32b2-b2ac-2db3f1406411,71b7ae3e-b21e-11e0-90ab-001ec93afa2c&size=10&_source=117f2e36-0756-4652-816b-d8ed175d9628,224517f5-bdaa-4ff1-a021-54bcc3162c2e,f6260c83-0229-4a59-97da-cb451457feea&output_context=true
Sample Returned Results
{
"context": {
"71b7ae3e-b21e-11e0-90ab-001ec93afa2c": {
"io_application": {
"datatype": "io_relationship",
"name": "Application"
},
"io_custodian": {
"datatype": "io_relationship",
"name": "Custodian"
},
"io_owner": {
"datatype": "io_relationship",
"name": "Owner"
}
},
"016e5041-d28e-32b2-b2ac-2db3f1406411": {
"io_application": {
"datatype": "io_relationship",
"name": "Application"
},
"io_custodian": {
"datatype": "io_relationship",
"name": "Custodian"
},
"io_owner": {
"datatype": "io_relationship",
"name": "Owner"
}
}
},
"records": [
{
"io_application": "Max",
"_io_application": "6c0f1c54-71dd-4271-8865-d17f14cea59f",
"io_custodian": "ServiceMax",
"_object_name": "Application",
"io_owner": "Sam Dai",
"_io_custodian": "c9d336e0-824c-4be1-9bf2-feff5261b69e",
"_record": "6c2e57e1-0bfe-4261-8da3-64d076db9b1e",
"_record_name": "Max BPM",
"_score": "3.920701",
"_io_owner": "9e992754-f4cd-4a0a-820e-99ae54a455fc",
"_object": "71b7ae3e-b21e-11e0-90ab-001ec93afa2c"
},
{
"io_application": "Max BPM",
"_io_application": "6c2e57e1-0bfe-4261-8da3-64d076db9b1e",
"io_custodian": "ServiceMax",
"_object_name": "Application",
"io_owner": "Sam Dai",
"_io_custodian": "c9d336e0-824c-4be1-9bf2-feff5261b69e",
"_record": "ae5a99b2-b7c8-4bbc-90d2-dfca254d67a7",
"_record_name": "Max BRM",
"_score": "2.766375",
"_io_owner": "9e992754-f4cd-4a0a-820e-99ae54a455fc",
"_object": "71b7ae3e-b21e-11e0-90ab-001ec93afa2c"
},
{
"io_application": "Max ESB",
"_io_application": "2077a249-ceca-443c-a068-ca1479f94f61",
"io_custodian": "ServiceMax",
"_object_name": "Object",
"io_owner": "Johnny Song",
"_io_custodian": "c9d336e0-824c-4be1-9bf2-feff5261b69e",
"_record": "143a2e83-1d8f-40ab-8e67-05ec5874f202",
"_record_name": "Initiate Process",
"_score": "2.3391395",
"_io_owner": "bbab3234-b9dc-11e0-adfd-00ff8314382b",
"_object": "016e5041-d28e-32b2-b2ac-2db3f1406411"
},
{
"io_application": "Max ESB",
"_io_application": "2077a249-ceca-443c-a068-ca1479f94f61",
"io_custodian": "ServiceMax",
"_object_name": "Object",
"io_owner": "Johnny Song",
"_io_custodian": "c9d336e0-824c-4be1-9bf2-feff5261b69e",
"_record": "edcc5cbe-aa1d-437a-b801-4ee36fadf350",
"_record_name": "Send To Process",
"_score": "1.8815696",
"_io_owner": "bbab3234-b9dc-11e0-adfd-00ff8314382b",
"_object": "016e5041-d28e-32b2-b2ac-2db3f1406411"
}
]
}
• Auto-complete suggest for prefix query:
POST https://localhost:8080/suggest
{
"suggest": {
"type-suggest" : {
"prefix" : "Notificat",
"completion" : {
"size": 20,
"field" : "c74f2dd8-b910-11e0-87b3-00ff79122e2e.suggest"
}
}
}
}
Sample Returned Results
{
"_shards": {
"total": "1",
"successful": "1",
"failed": "0"
},
"hits": {
"total": "0",
"max_score": "unsupported",
"hits": []
},
"took": "9",
"timed_out": false,
"suggest": {
"type-suggest": [
{
"text": "Notificat",
"offset": "0",
"length": "9",
"options": [
{
"text": "Notification",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "806fe4af-40ef-4882-a0a0-7c59ec257df7",
"_score": "unsupported",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Request",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "80f2cfbe-5db8-4c1a-aa60-492fa9345897",
"_score": "unsupported",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Template",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "66124250-e151-4da0-9f89-2d3b9f0206f4",
"_score": "unsupported",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
}
]
}
]
}
}
• Auto-complete suggest for prefix query with category filter:
POST https://localhost:8080/suggest
{
"suggest": {
"type-suggest" : {
"prefix" : "Notificat",
"completion" : {
"size": 20,
"field" : "c74f2dd8-b910-11e0-87b3-00ff79122e2e.suggest",
"contexts": {
"type": [
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
}
}
}
}
Sample Returned Results
{
"_shards": {
"total": "1",
"successful": "1",
"failed": "0"
},
"hits": {
"total": "0",
"max_score": "unsupported",
"hits": []
},
"took": "0",
"timed_out": false,
"suggest": {
"type-suggest": [
{
"text": "Notificat",
"offset": "0",
"length": "9",
"options": [
{
"text": "Notification",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "806fe4af-40ef-4882-a0a0-7c59ec257df7",
"_score": "unsupported",
"contexts": {
"type": [
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Request",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "80f2cfbe-5db8-4c1a-aa60-492fa9345897",
"_score": "unsupported",
"contexts": {
"type": [
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Template",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "66124250-e151-4da0-9f89-2d3b9f0206f4",
"_score": "unsupported",
"contexts": {
"type": [
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
}
]
}
]
}
}
• Auto-complete suggest on multiple fields:
POST https://localhost:8080/suggest
{
"suggest": {
"type-suggest" : {
"prefix" : "system set",
"completion" : {
"size": 5,
"field" : "cfbbfafa-b366-11e0-9e9b-001ec93afa2c.suggest"
}
},
"type2-suggest" : {
"prefix" : "noti",
"completion" : {
"size": 5,
"field" : "c74f2dd8-b910-11e0-87b3-00ff79122e2e.suggest"
}
}
}
}
Sample Returned Results
{
"_shards": {
"total": "1",
"successful": "1",
"failed": "0"
},
"hits": {
"total": "0",
"max_score": "0.0",
"hits": []
},
"took": "378",
"timed_out": false,
"suggest": {
"type-suggest": [
{
"text": "system set",
"offset": "0",
"length": "10",
"options": [
{
"text": "System Setting",
"_index": "max_records_index",
"_type": "86291014-1bd9-358b-a56b-8ddae7e8af24",
"_id": "26677fcc-b84d-4a96-9b60-ceb35e618f82",
"_score": "1.0",
"contexts": {
"type": [
"null",
"86291014-1bd9-358b-a56b-8ddae7e8af24"
]
}
},
{
"text": "System Setting",
"_index": "max_records_index",
"_type": "86291014-1bd9-358b-a56b-8ddae7e8af24",
"_id": "7c4642a9-c16b-46f7-9211-9645b3c65bff",
"_score": "1.0",
"contexts": {
"type": [
"null",
"86291014-1bd9-358b-a56b-8ddae7e8af24"
]
}
},
{
"text": "System Setting Supported Languages",
"_index": "max_records_index",
"_type": "86291014-1bd9-358b-a56b-8ddae7e8af24",
"_id": "3ba2e704-244f-43fd-84bd-1cb4f63e51c3",
"_score": "1.0",
"contexts": {
"type": [
"null",
"86291014-1bd9-358b-a56b-8ddae7e8af24"
]
}
},
{
"text": "System Setting of Email Credential is not enabled,",
"_index": "max_records_index",
"_type": "86291014-1bd9-358b-a56b-8ddae7e8af24",
"_id": "6681d136-7b87-4612-9ea8-270e6c27a185",
"_score": "1.0",
"contexts": {
"type": [
"null",
"86291014-1bd9-358b-a56b-8ddae7e8af24"
]
}
},
{
"text": "System Settings",
"_index": "max_records_index",
"_type": "86291014-1bd9-358b-a56b-8ddae7e8af24",
"_id": "635918da-b9ec-41c9-bb5b-08c9de66d445",
"_score": "1.0",
"contexts": {
"type": [
"null",
"86291014-1bd9-358b-a56b-8ddae7e8af24"
]
}
}
]
}
],
"type2-suggest": [
{
"text": "noti",
"offset": "0",
"length": "4",
"options": [
{
"text": "Notification",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "806fe4af-40ef-4882-a0a0-7c59ec257df7",
"_score": "1.0",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Request",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "80f2cfbe-5db8-4c1a-aa60-492fa9345897",
"_score": "1.0",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
},
{
"text": "Notification Template",
"_index": "max_records_index",
"_type": "016e5041-d28e-32b2-b2ac-2db3f1406411",
"_id": "66124250-e151-4da0-9f89-2d3b9f0206f4",
"_score": "1.0",
"contexts": {
"type": [
"null",
"016e5041-d28e-32b2-b2ac-2db3f1406411"
]
}
}
]
}
]
}
• Auto-complete suggest on object suggest field:
POST https://localhost:8080/suggest
{
"_source": true,
"suggest": {
"type-suggest" : {
"prefix" : "UI Unit T",
"completion" : {
"size": 20,
"field" : "294ae5eb-952b-467e-a2fc-d27751221d2a_t.suggest"
}
}
}
}
Sample Returned Results
{
"_shards": {
"total": "1",
"successful": "1",
"failed": "0"
},
"hits": {
"total": "0",
"max_score": "unsupported",
"hits": []
},
"took": "1",
"timed_out": false,
"suggest": {
"type-suggest": [
{
"text": "UI Unit T",
"offset": "0",
"length": "9",
"options": [
{
"text": "UI Unit Test Sample Record",
"_index": "max_records_index",
"_type": "294ae5eb-952b-467e-a2fc-d27751221d2a",
"_id": "41f19ff6-2738-4000-8bfd-a18950caa1d1",
"_score": "unsupported"
},
{
"text": "UI Unit Test Sample Record 2",
"_index": "max_records_index",
"_type": "294ae5eb-952b-467e-a2fc-d27751221d2a",
"_id": "42f64596-c42f-4ba2-8138-cc40188d2a88",
"_score": "unsupported"
}
]
}
]
}
}
• Search on attachments:
|
The following example shows a request to include attachments to Task records in a search.
|
{
"q":"Scheduling Analytics",
"_source":"78f92a42-0228-419f-b455-601c4fff85e6,1389724a-537d-4c76-8203-6e94f0c48129,584b3176-1db6-4bd3-aa4a-2cf7de65838c,117f2e36-0756-4652-816b-d8ed175d9628,8620ee14-5611-4722-842d-84f4354c67dc","search_fields":"id,name:50,content",
"search_attachment":true,
"attach_objects":"db13a9ad-2494-34bb-8a59-cb99fd308051",
"type":"db13a9ad-2494-34bb-8a59-cb99fd308051"
}
Sample Returned Results
|
In the following results, the "doc_type":"f" field-value pair indicates an attachment. The related_oid and related_rid field values indicate the record to which the attachment belongs. The size field value is returned only when the attachment is from the version record.
|
[
{
"size":"80896 B",
"_object_name":"Version",
"media_type":"63e0c4e2-bc48-11e0-8155-001ec950a80f",
"related_rid":"7640b7e1-d238-49d7-9d0c-97b3c4f64eb9",
"_record":"bf4b1baa-3e04-4c12-98f6-aeb6e33883b3",
"_record_name":"SB_221c_Patch2_RNs_Draft1_Reviewd.pdf",
"related_oid":"db13a9ad-2494-34bb-8a59-cb99fd308051",
"doc_type":"f",
"_score":"12.33941",
"_object":"6bd99fd6-b21e-11e0-90ab-001ec93afa2c"
}
]
For more information: