CID schema

4 views
Skip to first unread message

Shannon

unread,
Sep 23, 2009, 8:15:35 PM9/23/09
to Scriblio
The Community Information Database files have been updated. They
represent a full CID schema, currently being used by members of my
library network. Live site coming soon.

Still on the to-do list: searching the full record. Any advice?

Thanks,
Shannon

Casey Bisson

unread,
Sep 23, 2009, 10:33:00 PM9/23/09
to scri...@googlegroups.com

Great!

Searching is pretty easy. Take a look at the marcish_parse_words()
function in scriblio.php

http://plugins.trac.wordpress.org/browser/scriblio/trunk/scriblio.php#L2554

That function works very much like the functions that parse the record
and generate an html representation, except that it's just plain text
(and only the parts of the record that you want to make searchable).
It gets called from the marcish_pre_content() function, which is
registered as a filter on the scrib_meditor_pre_content filter hook.

http://plugins.trac.wordpress.org/browser/scriblio/trunk/scriblio.php#L2252
http://plugins.trac.wordpress.org/browser/scriblio/trunk/scriblio.php#L2106

The scrib_meditor_pre_content filter gets called just before the post
is saved to the database, and the result that's returned is saved in
the post_content field of the wp_posts table. That text is then what
gets indexed by Scriblio's keyword search tools as well as other
WordPress search plugins and the built-in WordPress search.

Hopefully that will point you down the right path,

--Casey

Casey Bisson

unread,
Sep 24, 2009, 7:30:30 AM9/24/09
to scri...@googlegroups.com

Actually, my previous advice is not appropriate for CID, because CID
uses the WP post_content field for the organization's description.

You can merge the two parts, but you'll have to be able to unmerge
when the record is displayed.

Sent from my iPhone

Shannon

unread,
Sep 24, 2009, 2:07:39 PM9/24/09
to Scriblio
Alternately, I could create a short description field within the CID
schema, right? Then use the post_content field like Scriblio does.
Then I would also need to create an excerpt with something like
marcish_parse_excerpt, since post_content is the source of the excerpt
currently. Does that sound correct?

Thanks,
Shannon

On Sep 24, 7:30 am, Casey Bisson <ca...@scriblio.net> wrote:
> Actually, my previous advice is not appropriate for CID, because CID  
> uses the WP post_content field for the organization's description.
>
> You can merge the two parts, but you'll have to be able to unmerge  
> when the record is displayed.
>
> Sent from my iPhone
>

Casey Bisson

unread,
Sep 24, 2009, 2:58:34 PM9/24/09
to scri...@googlegroups.com

The advantage of using WP's built in post_content field for the
description is that you get wysiwyg editing. That may be less
important for records coming from the OPAC, but useful for
applications where the records are being created (or managed) within WP.

The fulltext terms can still be stuffed in the post_content field, but
they'll need to be filtered out when the record is edited and
displayed. We're already filtering the post_content when it's
displayed -- the cid_the_content() does that -- so all we need to do
is add a bit of logic there to help it out.

Let's assume that the post_content field looks like this after the
fulltext terms are added:

> A rambling description of the program, perhaps with html elements.
> etc. etc. etc.
>
> ###FULLTEXT_TERMS###
> a subject heading
> or two
> and other keywords

We can then strip that out of the post_content on display like this:

preg_replace( /'###FULLTEXT_TERMS###.*/s' , '', $the_content )

And by hooking to the format_to_edit filter, we can clean up the
post_content for editing in the CID editor.

At least I think that makes sense,

--Casey

Reply all
Reply to author
Forward
0 new messages