Site:Frontend:Faceted Search
Contents |
Introduction
Faceted search allows you to perform additional filtering on your objects by referencing a combination of custom fields that you created. This allows a simplier search interface without having to complicate the labeling system. You can do this by simply adding parameters to the URL.
Accounts
You can query custom attributes on accounts using the "account_" prefix. For example, if you created an custom field of "type" on your account objects with the possible values of "superuser" or "normal", then you could request the accounts that are superusers by adding "account_type=superuser" to your URL.
Content
You can query custom attributes on accounts using the "content_" prefix. For example, if you created an custom field of "flagged" on your content objects with the possible values of "yes" or "no", then you could request the content that is not flagged by adding "content_flagged=no" to your URL.
Multi-level Search
The faceted search allows you to perform deeper queries depending on your site page context.
Accounts of Content
If your page context is accounts, and you wanted to see account profiles that had flagged content, then you could do this by simply adding "content_flagged=yes" to your URL and internally the search mechanism would know to extend the search by referencing the content fields.
Content of Accounts
If your page context is content, and you wanted to see the content that belonged to all superuser accounts, then you could do this by simply adding "account_type=superuser" to your URL and internally the search mechanism would know to extend the search by referencing the account fields.
Multiple Values
The faceted search allows you to reference multiple values for a particular field. You can accomplish this by adding "[]" to the end of your parameter name.
For example, if you wanted to search for accounts that have a type of either superuser or normal, then you would accomplish this with the following additions to your URL: account_type[]=superuser&account_type[]=normal
Defaults
You can configure defaults either globally throughout the site or on a per page basis. The global defaults are under the site's properties, and the page defaults are under the page properties. The format of these defaults are name=value pairs.
An example of using defaults would be a flagged content mechanism. Inappropriate content is normally solved by users using a flagging mechanism. If content was flagged, then you would want it to be immediately removed from your website. You could accomplish this by setting a default setting of "content_flagged=no" globally in your site properties. You would then create an additional custom field to hold the value of the flagging outcome and then remove the ability to further flag that content, if it is indeed appropriate.