すべてのアセットの検索
get
/resources/v1/search/assets
次の表に、クライアント・リクエストをまとめます。
問合せパラメータ
| 名前 | 説明 | 形式 |
|---|---|---|
| countonly | ブール値を受け入れます。trueに設定すると、件数のみ表示され、結果は返されません。デフォルトはfalseです。 | ブール |
| field:[fieldname]:[operation] | 指定した演算を使用した[fieldname]のフィールドに対する問合せ条件を指定します。[Operation]はオプションで、equals、range、startswith、phrase、wildcard、similarまたはcontainsのいずれかを指定できます。デフォルトはcontainsです。range演算については、値の書式は{lower bound}:{upper bound}(たとえば、1:10)です。 | 文字列 |
| fields | 各検索結果の属性名のカンマ区切りのリストを受け入れます。デフォルトでは、各検索結果の名前と説明のみ返されます。 | 文字列 |
| limit | 返されるアイテムの合計数を指定します。 | 数値 |
| links | リンク名のカンマ区切りのリストを受け入れます。デフォルトでは、このパラメータですべてのリンク(next、prev、first、last、schema、selfおよびcanonicalリソース)が返されます。 | 文字列 |
| offset | 結果を返す開始地点となる開始索引を指定します。 | 数値 |
| orderBy | 結果のソート基準になるフィールドを指定します。 使用方法: orderBy=[fieldname]:[asc/des]。 注意: Luceneでは、トークン化されていない索引付けフィールドのみソートできます。 |
文字列 |
| q | 問合せ文字列を指定します。これは、構成時に指定された検索エンジン固有の問合せです。(デフォルトの検索エンジンはLuceneです。) | 文字列 |
| searchengine | 検索に使用する検索エンジンを指定します。デフォルトの検索エンジンはLuceneです。 | 文字列 |
| totalResults | ブール値を受け入れます。trueに設定すると、レスポンスに結果総数フィールドが表示されます。デフォルトはfalseです。 | ブール |
次の表に、サーバー・レスポンスをまとめます。
サポートされるメディア・タイプ
- application/json
- application/xml
200レスポンス
すべてのアセットのリスト
次の例に、cURLを使用してRESTリソースに対するGETリクエストを送信し、WebCenter Sitesで名前が"1"で始まるすべてのアセットを取得する方法を示します。
問合せパラメータの詳細:
"field:name:startswith=1": フィールド名は"1"で始まります。
curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/search/assets?field:name:startswith=1"
レスポンス・ヘッダーの例
次の例に、レスポンス・ヘッダーを示します。
Cache-Control: max-age=0 ETag: "28ee44a36ad3a790ffca5d531468e6718d2df423cd4d84f2c5a4d247613e334d" Content-Type: application/json;charset=utf-8
レスポンス本文の例
次の例に、JSON形式のレスポンス本文のコンテンツを示します。
{
"offset": 0,
"limit": 2,
"count": 2,
"hasMore": false,
"links": [
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/search/assets?field:name:startswith=1",
"rel": "self",
"templated": false,
"mediaType": "",
"method": "",
"profile": ""
},
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/search/assets?field:name:startswith=1",
"rel": "canonical",
"templated": false,
"mediaType": "",
"method": "",
"profile": ""
},
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/search/assets",
"rel": "describedby",
"templated": false,
"mediaType": "application/schema+json",
"method": "GET",
"profile": ""
},
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/search/assets?field:name:startswith=1&offset=0",
"rel": "first",
"templated": false,
"mediaType": "",
"method": "",
"profile": ""
},
{
"href": "http://<host>:<port>/<context>/REST/resources/v1/search/assets?field:name:startswith=1&offset=0",
"rel": "last",
"templated": false,
"mediaType": "",
"method": "",
"profile": ""
}
],
"items": [
{
"name": "10 Important Baseball Rules for beginners",
"link": {
"href": "",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
},
"description": "",
"id": "AVIArticle:1330881074927"
},
{
"name": "100 Meter Sprint Versus A Marathon",
"link": {
"href": "",
"rel": "assetReference",
"templated": false,
"mediaType": "",
"method": "GET",
"profile": ""
},
"description": "",
"id": "AVIArticle:1363104065090"
}
]
}