Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Order of Search Results Returned
foiplus
Is there a way to specify the order of the search results being returned? (I'd like to order them by a particular metadata field)
Thanks in advance!
Faith
**Just for reference on how I'm searching programatically; below works as is **
// Set up the search criteria
MBSearchCriteria criteria = new MBSearchCriteria();
criteria.setMContainerID(containerID);
criteria.setMAssetID( null );
criteria.setMRecursive(true);
criteria.setMMaxHits(maxResults);
// Setting up constraints...(removed code for post b/c it's long...)
// Set the critera as an array of search constraints
ArrayOfMBSearchConstraint arrConstraints = new ArrayOfMBSearchConstraint();
arrConstraints.setMBSearchConstraint( constraints );
criteria.setMSearchConstraints( arrConstraints );
// Perform the search
ArrayOfMBAsset asset = new ArrayOfMBAsset();
asset = mMediaBinServer.search(criteria, true);
Find more posts tagged with
Comments
lyman
This functionality was introduced in MediaBin 4.5.2. What version of the server are you running currently?
Lyman Hurd
foiplus
D'oh! I think we are running 4.5.1.
Migrateduser
Looking at the code you've submitted, it looks like you're using the Web Services API. If you can use the COM API, you would be returned a collection which then can be sorted using many predefined sort predicates. If you required more complex sorting (like multiple column sorts), you could write your own comparison function to be called by the collection's sort function. Unfortunately, I'm not familiar with Web Services.
I believe Lyman was speaking of a way to configure MediaBin server directly using MediaBin Enterprise Manager. There is a setting that can be used to specify sort order in version 4.5.2. That setting would change the default sort order for COM collections (although they can easily be resorted), and I'm guessing for Web Services as well. It wouldn't affect the MediaBin web client because the web client's application code (ASP) always resorts the collection.
msnider
Currently, the Web Service API does not allow you to specify a specific sort order....it defaults to order by name.
While sort order is supported thru the MediaBin server and the COM API, it has not been ported to the Web Service API yet.
Mark