Date ranges in avanti

Thomas Berger at
Mo Dez 13 13:27:52 CET 1999


since you directed your question to the common 
allegro discussion list let me take over with
some hints.

> I would like to implement date ranges when searching with
> avanti.
> In the search web pages there will be two boxes marked
> Year: from [ ] to [ ]
> A blank box means any year.

this can easily be achieved by means of "restrictions".
In the standard cat.api you will find the ordinary
register declaration

I VOJ 6 "publisher"

and the special declaration

R PYR r1 "date of publication"

(the code at #-/ in cat.api indexes a four-digit 
year which should be zero-padded into positions
1 to 4 of the .res table)

> Eg given two separate indexes (5) Publisher and (7) Dates
> how do you construct the query "Items published by Cooper
> before 1670" in avanti.

the command should be

find VOJ "Cooper?" and PYR<=1670

(note the quoting of ordinary search terms vs.
the search operator, missing spaces etc. in
case of search with restrictions).

In the general form with both years entered
by the user the query should be (in one line)

find (... ordinary combined query ...) and PYR<=YearEnd and 

All together: In your .cgi script you should create
the ordinary query and then determine which of the
two special year-fields are nonempty, for those you
then have to put the already constructed terms in
brackets and append the appropriate restriction.

Thomas Berger

Mehr Informationen über die Mailingliste Allegro