[Zebralist] date comparison syntax in pqf?
mike at indexdata.com
Thu May 29 13:27:39 CEST 2008
Walter McGinnis writes:
> I'm putting together a bridge between the OAI Ruby Gem's repository
> functionality and a ZOOM interface to OAI DC records.
> Things are going quite well generally. I know how to sort my results
> by an index on oai_datestamp (e.g. get latest or earliest record), but
> I'm getting caught in some datetime comparisons. It seems like @attr
> 2=x is the key, but experiencing a couple things that leave me
> scratching my head.
> 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:
>  Unsupported Use attribute -- v2 addinfo '1012'
> If I add a w index and rebuild my indexes, I can do " f @attr 2=1
> @attr 1=1012 2008-05-29" and get results that I expect. Seems a
> little weird that I have to add an word index for this to work.
This part I can't really help you with -- I'll leave it for Adam.
> Things break again if I add time to the query like so:
> Z> f @attr 2=5 @attr 1=1012 '2008-05-29 11:31:49'
> f @attr 2=5 @attr 1=1012 '2008-05-29 11:31:49'
> Prefix query error: extra token (code 1)
> If I escape the colons, I still get the same error.
Here I think your problem is simply that you need to use
double-quotes, not single, to enclose a multi-word token for the PQF
Z> f @attr 2=5 @attr 1=1012 "2008-05-29 11:31:49"
/o ) \/ Mike Taylor <mike at indexdata.com> http://www.miketaylor.org.uk
)_v__/\ "If any of the opposing players dance about or gesticulate
[...] it shall be deemed ungentlemanly conduct" -- FIFA law 15,
FA board decision 3.
More information about the Zebralist