You can easily define the new interface using macros but it is harder to
actually use the functionality you have just added.
Adding a new option to the search form is easy if it's static. Start by
looking at queryform, queryformcontent etc macros in query.dm. Some of
the bits are defined in english.dm (or other language macro files)
To actually get the searching to use your new option is a bit harder.
Are you using mgpp for indexing?
If you have just one new metadata option to add in (eg internal/external
docs) you could try:
* make subcollections for internal/external docs - the interface will
automatically give you a selection box for this. this will work for
mg/mgpp. This is the only option that will work with mg.
* if you use mgpp and form searching, and index the internal/external
metadata, users can use that in a fielded search, eg 'cat in Title and
internal in DocType' for example. This is not so nice as a check box or
switch between internal/external. However it will work without changing
the interface, and for as many metadata elements as you want.
* you can add a new item to the interface and then modify the code to
internal/external bit to the query string. This will not work very well
if you are already doing fielded search as the query string already gets
or you can change the queryaction to add in your new option. you will
need a new cgi arg to store the option value, then you can use that to
add extra info to the query string.
Have a look at src/recpt/queryaction.cpp:get_formatted_query_string()
for examples of where we modify the query string.
Well, I hope this has been useful and not too confusing.
Have a play with some of the options, and if you need any help let me know.
Doug Carter wrote:
> Hi all,
> I'd like to change the search interface in my Greenstone setup. I
> have some binary metadata, where the values are "yes" or "no". For
> example, I'd like to have some metadata for "internal" or "external"
> documents. In the search interface, I'd like to have a checkbox for
> "internal", so that a user can enter some key words for searching,
> then optionally check the "internal" box to find only those documents
> that match the key words and are also "internal" documents.
> I know that the produced html is all driven by macros and that it's
> only a matter of defining some new macros to define this interface.
> My question is, are they any good approaches to developing new macros?
> I've found it a bit confusing to associate macros with html output,
> due to the dynamic nature of Greenstone.
> Is macro definition the right approach? Or is there a better way?
> Doug Carter
> Mercy Corps
> greenstone-devel mailing list