[Zebralist] date comparison syntax in pqf?

Walter McGinnis walter at katipo.co.nz
Thu May 29 23:03:45 CEST 2008


On May 30, 2008, at 12:44 AM, Oleg Kolobov wrote:

> В чт, 29/05/2008 в 11:49 +1200, Walter McGinnis пишет:
>> Hi,
>>
>> ...
>> If I only have 0,d,s indexes on oai_timestamp index and I try a query
>> like " f @attr 2=1 @attr 1=1012 2008-05-29" I get this:
>>
>> Diagnostic message(s) from database:
>>     [114] Unsupported Use attribute -- v2 addinfo '1012'
>
> Probably it is server-side things. What kind of server are using?

Zebra 2.0.26 (holding back until I have time to work through  
compatibility issues) on Debian etch.
>
>
> For current version of Zebra we have to use structure attribute in a
> query
>
>        @attr 4=3 for a index type '0'
>        @attr 4=5 for a index type 'd'
>
> and the query type like this
>
>        f @attr 2=1 @attr 1=1012 @4=3 "2008-05-29"
> or
>        f @attr 2=1 @attr 1=1012 @4=5 "2008-05-29"
>
>
> -- Oleg



By specifying structure (5, date normalized) as you suggest, things  
work up to a point without adding a "w" index type:

Z> f @attr 2=4 @attr 1=1012 @attr 4=5 "2008-05-29"
f @attr 2=4 @attr 1=1012 @attr 4=5 "2008-05-29"
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 14, setno 5
SearchResult-1: term=2008-05-29 cnt=14
records returned: 0
Elapsed: 0.384677

Works with a datetime, too:

Z> f @attr 2=1 @attr 1=1012 @attr 4=5 "2008-05-29 12:30:01"
f @attr 2=1 @attr 1=1012 @attr 4=5 "2008-05-29 12:30:01"
Sent searchRequest.
Received SearchResponse.
Search was a success.
Number of hits: 15, setno 21
SearchResult-1: term=2008-05-29 12:30:01 cnt=15
records returned: 0
Elapsed: 0.002899

I found this section of the User guide useful:

http://www.indexdata.dk/zebra/doc/querymodel-rpn.tkl#querymodel-bib1-structure

Thanks for the answers Mike and and Oleg!

Cheers,
Walter




More information about the Zebralist mailing list