Skip to main content.
home | support | download

Back to List Archive

Re: PropertyNames in C-API?

From: Jamie Herre <jlst(at)not-real.gettysgroup.com>
Date: Wed Mar 10 2004 - 20:44:35 GMT
On Mar 10, 2004, at 12:12 PM, Bill Moseley wrote:

> On Wed, Mar 10, 2004 at 09:10:06AM -0800, Jamie Herre wrote:
>>
>> const char **SwishPropertyNames( SW_HANDLE );
>
> The properties and metanames are related to a specific index, so the
> handle won't work alone -- need to also specify the index file name.

Doh! Of course. np.

> So, what's needed is two (already have one, I think) null terminated
> tables that are a list of pointers to props/metas.  That would give a
> way to generate a list of objects in Perl or other higher language.
>
>    void **prop_list = SwishFetchPropList( sw_handle, "index_file" );
>    const char *name SwishProperty_name( prop_list[0] );
>    int id SwishProperty_id( prop_list[0] );

Also  PropType SwishProptery_type( prop_list[0] );  ?

>> I'm also guessing that SwishPropteryNames() should return all property
>> names in the index and we'd follow the convention that those beginning
>> with "swish" are standard and those which do not were set via
>> PropertyNames directives.
>
> You can say: MetaNames swishtitle swishdocpath so the distinctions are
> not clear -- the swish* ones are just pre-defined.  I wouldn't put any
> logic into the API for excluding swish* names.

Yeah, that's what I meant.  But make known the convention that 
pre-defined
names begin with "swish" so that users can use that to distinguish if 
they
so choose.  This makes possible an interface with no specific knowledge 
of
the pre-defined property names used by a given version of swish-e.

>
>> Anyway, I'd like to do it in a way that I could contribute back so let
>> me know if I'm on the right track or not.
>
> If you are up for code hacking that's great.  Look at metanames.c for
> ideas.  Need to make sure that there's the mapping tables for each
> property in the index's header and provide methods to access them.
>
> So does that API make sense?  I may be forgetting something obvious.
> Like I said, I worked on this once before for a day and there was
> something that got in the way of implementing it.  I just can't
> remember what that was.
>
I'll take a look.  This is more work than I had intended to do but 
given that
I've gotten a lot of good use out of swish-e it seems like the least I 
can
do.

Let me just make sure I'm understanding the difference between metas 
and props;
metas are attributes recorded in the index and props are a subset of 
metas which
are available in results?

Cheers,

-J
Received on Wed Mar 10 12:44:37 2004