The Metadata Plugin
Metadata Management for Manila
 
Site last updated
2/24/2006; 12:33:21 PM
 
Home

Why

Features

FAQ

Updates

Documentation

Download

Developers

Bugs

Feedback

Discuss

Planned
Features

 
 

Index Maintenance

...in which editing scores, boolean and radio fields, and a really nifty application thereof get explained.

Interacting with the index

For each meta type you create, the Metadata Plugin creates an index. The index consists of all the values that are assigned to that meta type.

For example, a boolean meta type has only two values, true and false. If you have a meta type called keywords and you have a website about the primary colors, the index for keyword may contain the values red, green and blue.

The Index Maintenance page lets you view what's in the index for each metatype-value pair. Here I am asking the system to show me the pages on my site that have the meta type keywords assigned the value red:

Index Maintenance Screenshot:

Note: there's now an additional option for Rebuilding an Index for a meta type, not shown in this screenshot.

I click the View button and here's what it shows me:

Red Stories Screenshot: Results.

I have two stories on my site whose metadata includes the keywords field with the value red. Cool. But notice that I've got a field called Score. I know that people searching for the keyword red will be far more interested in the page about the color red than about flags. So I can increase the score for that page using this interface. Note: setting the score to 0 prevents that entry from showing up in search results.

Boolean and radio field formats - creating a ranked table of contents

Looking at the first screenshot, above, I see that there is an Add button. I could use that button to add a value for a meta type. But why on earth would I want to do that? After all, I could just go to a page and enter the value in the metadata fields.

True, but boolean and radio field formats have a limited set of values from which you may choose. Booleans have Yes and No. Radios have any values you want to assign. But how do you assign those values? Hmm, maybe the Add button on the index maintenance screen has something to do with it. Aha! Now we're getting somewhere.

Suppose you want to divide your site into four sections, News, Jokes, Recipes and Parodies. You want to be able to select a section when you create a new story. Here is the new story form you want to see:

Sections Screenshot: New story with sections metatype.

How do we get that Section metatype with the radio buttons? Here's how. First we added a new meta type called Section. We set its format to radio and made sure it was indexed:

Meta Types Section Screenshot: Settings for Section meta type.

Then we went to the Index Maintenance screen and added the values we wanted, starting with News:

Add News Section Screenshot: Adding a choice for a radio button.

After News we added Jokes, Recipes and Parodies.

The neat thing is that now we can generate a listing of pages within sections automatically, using the searchkw macro:

{metaDataMacros.searchkw(metaname,metavalue)}

Yeah, you say, but you alread knew that, having read the Why the Metadata Plugin is Important piece. OK, let's make the macro more useful by reordering the pages into an order that we want. We can use what we learned about editing the score to assign placement for pages in our table of contents. Pages we want listed early in the list get high scores, pages that are listed later get low scores. First we'll request to see the list of pages in the News section:

News Maintenance Screenshot: Requesting News entries.

This will give us the following list:

News Entries Screenshot:

Now we can reorder them the way we want. We can use any numerical values we want, since it sorts numerically. I'll just use the numbers from 1 to 100.

News Reordered Screenshot: News pages with weights assigned.

Now when we put the macro {metaDataMacros.searchkw("Section","News")} in a page, we'll get our ordered table of contents for the News section:

Comments...


This page last updated Sunday, October 21, 2001 at 4:08:01 PM. (7910)