About Search

About Search

Contents

Introduction

Call search method to search for files or folder in the user’s Personal Cloud Storage account.

Examples

The following code samples can make using the search method easier.

Search for Files

This code sample results in the listing of all files.

Code Sample

thingspace.cloud.search({
    query: ".jpg",
    success: function(success) {
                    var filesFound = success.body.searchResults.file;
                                }
})

Search for Recent Updates

You can use this code sample to search for recently updated files by specifying versionCreated. versionCreated lists the date and time of the last change to the file.

Code Sample

thingspace.cloud.search({
	"sort":"versionCreated+desc", 
	"query" : "file:true",
	"success" : function(success) {
		var files = success.body.searchResults.file;
	}
});
```	
	
### Search by Extension

This code sample lists all files with a `jpg` extension.

**Code Sample**

```javascript
thingspace.cloud.search({
	"query" : "extension:jpg",
	"success" : function(success) {
		var files = success.body.searchResults.file;
	}		
});

Search for Content

This code sample lists all audio files by specifying content type of audio/mpeg.

Code Sample

thingspace.cloud.search({
	"query" : "contentType:audio/mpeg",
	"success" : function(success) {
		var files = success.body.searchResults.file;
	}				
});	

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.