Site:Frontend:Faceted Search

From Metrixstream
(Redirected from Site:Faceted Search)
Jump to: navigation, 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 simpler 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.

Whitelist

Faceted search is not enabled by default. Because some custom fields are for internal referencing only, it would be a security risk to expose the ability to search by every possible custom field. This is why we provide a whitelist mechanism, where you are able to have control over what fields are triggered via the URL. You can whitelist these parameter names globally within the site or on a per page basis.

Stickiness

Sometimes it is convenient to have certain URL parameters persist from page to page. This can be become complicated and error prone as the number of possible fields grows. By leveraging the browser's cookie system, we can remove this complexity from the URL and rely on parameters being used from page to page. This can be done by using the sticky parameter.

Example: http://www.test.com/?content_flagged=yes&sticky=content_flagged

You can also set multiple fields to be sticky using the "[]" property.

Example: http://www.test.com/?content_flagged=yes&content_premium=no&sticky[]=content_flagged&sticky[]=content_premium

If you ever want to clear the state of the sticky cookie, then you can accomplish this by setting stickymode=new.

Example: http://www.test.com/?stickymode=new

Experimentation

You can experiment with faceted search from within Metrixstream. You don't need to rely on creating a website to see this feature. You can do it right now on the Browse Content and Browse Accounts pages. Unlike the sites, these pages do not have a whitelist. All custom fields are exposed from within the admin panel. Simply add whatever fields you want to the URL to see the faceted search in action.

Personal tools