> Date: Wed, 22 Dec 2004 14:45:20 -0500
> From: Eric Lease Morgan <[log in to unmask]>
>
> > I've noticed that the cql-java implementation tosses an exception if I
> > try
> > to parse:
> >
> > foo bar
> >
> > Exception in thread "main" org.z3950.zing.cql.CQLParseException:
> > unknown
> > first-class relation: bar
> >
> > I just wanted to confirm that an unquoted sequence of terms is indeed
> > invalid CQL.
Yes, this is invalid. In CQL 1.0 (which is what CQL-Java implements),
it was invalid for the reason diagnosed here, namely that "bar" was an
invalid relation. In CQL 1.1, any word can function as a relation
[which I think is a mistake, but that's a different discussion for
another day], but the query "foo bar" is still illegal CQL 1.1,
because it's interpreted as index-name "foo", relation "bar" and then
no actual search-term.
> Yep, but I'm not really sure the query, foo bar, really is invalid.
> According to the Gentle Introduction to CQL:
>
> In general, multi-word terms are interpreted as requesting
> records in which a single field contains all the specified
> words, in the specified order, with no other words in
> between. This is a proximity search. But see the section
> below on relations for exceptions.
This referes to a multi-word term as opposed to a sequence of
single-word terms. That is, it describes how to interpret
"foo bar"
rather than
foo bar
_/|_ _______________________________________________________________
/o ) \/ Mike Taylor <[log in to unmask]> http://www.miketaylor.org.uk
)_v__/\ "What would the Coliseum have looked like if Liverpool city
council been in charge?" -- Paul Clough.
--
Listen to free demos of soundtrack music for film, TV and radio
http://www.pipedreaming.org.uk/soundtrack/
|