Re: [greenstone-users] Referencing & querying the search engine

From Katherine Don
DateTue, 28 Jun 2005 10:10:01 +1200
Subject Re: [greenstone-users] Referencing & querying the search engine
In-Reply-To (200506260835-j5Q8ZF40032437-dbmail-mx1-orcon-net-nz)
Hi Daniel

> Thanks for those who have answered my questions – very helpful and
> deeply appreciated. I’m quite impressed with how quickly a collection
> can be built up in Greenstone, kudos to all you people up there at
> Waikato university!
Thanks. :-)

> (1) I’d like to organize my collection, so the user can see record
> information either before they look at the record or as a separate link.
> At present, the only way I can think of to show the information is to
> edit the DocumentText or DocumentHeader fields so the information is
> given either at the top or bottom. Is it (easily) possible to make this
> a separate page?
You could display some record info in the search results/ browsing lists
by modifying the format statements.

Or you could have two formats for the document text, one showing record
details, the other showing the document. And you can switch between the
two using an argument.
Here is an example:

format DocumentText "{If}{help eq fulldoc,
<a href='/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Gordon+Paynter--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=d&d=42C07939-9090905-cs-waikato-ac-nz&p=details'>View the record
details</a> </br> display for the whole doc,
<a href='/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Gordon+Paynter--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=d&d=42C07939-9090905-cs-waikato-ac-nz&p=fulldoc'>View the whole
document</a><br/> display for the record details}"

> (2) As part of the above, I’d like to have the author name as a link to
> a query which gives all titles by that author.
> I thought I could do that like this (a section from my DocumentHeader)
> {If}{[ref.Author], <tr>
> <td align=right valign=top width=120><b>Author:</b></td>
> <td align=left valign=bottom width=325><a
> href=/gsdlmod?e=d-00000-00---off-0gsarch--00-0----0-10-0---0---0direct-10---4-----dfr--0-1l--11-en-50---20-help-Gordon+Paynter--00-0-1-00-0--4----0-0-11-10-0utfZz-8-00&a=q&q=[cgisafe:ref.Author]&h=Author>[ref.Author]</a></td>
> <td align=left valign=bottom width=325>[ref.Author]</td>,
> <td align=right valign=top width=120></td>
> <td align=left valign=bottom></td>}
You can do this, but you need to make sure you have the index name (h
arg) correct. Have a look at the build.cfg file in the collection's
index directory. this has a mapping between what you have specified for
the index in the collect.cfg and what its internal index id actually is.
use indexmap for mg colls, indexfieldmap for mgpp colls.

> Unfortunately this doesn’t work, it just brings up the search page
> without doing anything else. I had a look at Katherine’s example of how
> to do a httpquery in the archives
> (
> and this wouldn’t work for me either. Any ideas?
I can't access this archive (don't know my password) so I don't know
what I said in this email.
> (3) As part of my metadata, I would like to include links to other
> documents in the collection, by their title. So I’d have a field called
> references and use an expression similar to the above (if I could get it
> to work) which I would like to automatically search for that title, and
> if it brings back a unique record to pull it up directly. Is there any
> more direct way to refer to other documents or would this be the way to go?
You can use the argument ifl=1 (i feel lucky) in your query args and it
will display the first document in the search results, rather than
displaying the search results themselves.
> (4) I store the author’s name in a single field as LastName, FirstName.
> How can I extract that and organize it as I like. Sometimes I’d like to
> write something like “[Title] by [FirstName] [LastName]”. At present, I
> have two fields for author, one being FirstName LastName, the other
> being LastName, FirstName which seems a poor solution.
Maybe you could write a javascript that reformats the Author. I don't
think Greenstone has this functionality - we would just use two metadata
fields like you have.
Or maybe you could make the metadata [LastName], and [FirstName] then
you have complete control over how to display it.
However, I guess this would stuff up a Author classifier - you can't
sort on the concatenation of two metadata fields. You can sort by two
fields (LastName/FirstName) but I think you will get two levels in the tree.

I hope some of this helps,