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)
search criteria issue
jrMugz
Greetings,
We have criteria we offer a user to search by based on Metadata fields. The Metadata fields values can differ. For example, a field called "Business Unit" can have over 50 values to choose from. The user can select multiple business units for the Search Query. So a Search Criteria string can look like this:
Keywords = “Some Keyword” AND Business Unit = “Food and Beverage” OR Business Unit = “Products”
The problem is that once you use the OR join you break the criteria into two sections with the first being:
Keywords = “Some Keyword” and Business Unit = “Food and Beverage”
And the second being:
Business Unit = “Products”
Is there a way to group the one metadata field values, so it would act like
Keywords = “Some Keyword” AND (Business Unit = “Food and Beverage” OR Business Unit = “Products”)?
Also creating a separate group of criteria for each choice is not an option because there are 4 other metadata fields with choices that the user can select multiple values for. So a Criteria String can look like this:
Keywords = “Some Keyword” AND Business Unit = “Food and Beverage” OR Business Unit = “Products” AND uploader = “John Doe” or uploader = “Jane Doe” AND asset type = “Image” OR asset type = “Video”
Please let me know if there is a way to work around this. Thanks!
Jim
Find more posts tagged with
Comments
Rick Poulin
Keywords = “Some Keyword” AND (Business Unit = “Food and Beverage” OR Business Unit = “Products”)
Just to clarify, have you actually tried that syntax? It's been a while since I've built something with the MB API, but it seems to me like that would be the right way to do it. Parens are a pretty standard thing in boolean queries, and that's how LSCS does it.
jrMugz
Thank you for the response.
From our coding, there does not appear to be a way to use parentheses; as it allows you to build objects, not strings.
The coding for building search criteria is pretty involved. We used a hybrid of what was in the find.asp and what was in the SDK sample. Using their routines we just add a criteria item to the search object using either an intersect or union join. Intersect being an AND join and union being an OR join. From what we found, there appears to be no way to group sections of criteria. It is pretty linear. You just keep adding on.
Jim
Rick Poulin
Right. I just checked the API again and I'm seeing the same: you can only pass an array of search constraint objects, so it has to be linear. I thought I'd seen a search method that took a string, but I guess that was wishful thinking
I can only hope the MB/V API is better in that regard. I do know that the Virage portion added its own set of APIs, but I haven't had the opportunity to dive into that yet.
jrMugz
OK, thanks for checking into it.
Jim