SourceCodeGroupSearch resource (Data API 19.8)

Summary

Http Method Resource Description
POST /sites/{site_id}/source_code_group_search Searches for source code groups.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:
  • id - String
  • description - String
  • source_code* - String
  • start_time - DateTime
  • end_time - DateTime
  • creation_date - DateTime
  • enabled - Boolean
  • active* - Boolean

* - These fields can only be used in Queries as conjunctions (using AND). If the field is used in a disjunction (OR) an exception will be thrown.

The output of the query can also be sorted. These are the list of sortable attributes:

  • id - String
  • description - String
  • enabled - Boolean
  • creation_date - DateTime

Expands that can be applied for the search request

  • specifications - String

Search SourceCodeGroups

Searches for source code groups.

The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

* - These fields can only be used in Queries as conjunctions (using AND). If the field is used in a disjunction (OR) an exception will be thrown.

The output of the query can also be sorted. These are the list of sortable attributes:

Expands that can be applied for the search request

Url

POST https://hostname:port/dw/data/v19_8/sites/{site_id}/source_code_group_search

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SearchRequest

Response Document

SourceCodeGroupSearchResult

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 MalformedSearchParameterException   Thrown if the query is ill-formed.

Sample

REQUEST:
POST /s/-/dw/data/v19_8/sites/SiteGenesis/source_code_group_search?expand= HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json

{ 
   "query" : 
   { 
     "text_query": { "fields": ["id"], "search_phrase": "my" }
   } , 
   select: "(*,query.(**),hits.(id,description,link,start_time,specifications))",
   "expand": ["specifications"]
}


RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8

{
  "_v" : "19.8",
  "count" : 2,
  "hits" : [
    {
         "_type" : "source_code_group",
         "_resource_state":"c2309jd239jdrifj3ui4fn",
         "id" : "my_source_code_group1",
         "description" : "My source code group 1",
         "link" : "https://example.com/s/-/dw/data/v19_8/sites/SiteGenesis/source_code_groups/my_source_code_group1",
         "start_time" : "2014-11-15T00:00:00.000Z",
         "specifications" : 
         [
            {
               "_type" : "source_code_specification",
               "expression" : "wsc4"
            },
            {
               "_type" : "source_code_specification",
               "expression" : "wsc4?"
            }
         ]
    },  
    { 
         "_type" : "source_code_group",
         "_resource_state":"34d98jcdscn324uifn3c93",
         "id" : "my_source_code_group2",
         "description" : "My source code group 2",
         "link" : "https://example.com/s/-/dw/data/v19_8/sites/SiteGenesis/source_code_groups/my_source_code_group2",
         "start_time" : "2014-11-15T00:00:00.000Z",
         "specifications" : 
         [
            {
               "_type" : "source_code_specification",
               "expression" : "wsc4"
            },
            {
               "_type" : "source_code_specification", 
               "expression" : "wsc4?"
            }
         ]
     }    
  ],
  "query" : { "text_query": { "fields": ["id"], "search_phrase": "my" } },
  "select": "**",
  "start" : 0,
  "total" : 2
}