lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <ysee...@gmail.com>
Subject Re: Strange sort error
Date Thu, 14 Apr 2005 23:06:20 GMT
Hmmm, that's a great lucene architecture question.
Should one be allowed to sort on a field that doesn't exist?
One *can* query on fields that don't exist (and that's correct in my view).

The thing is, lucene field creation is lazy... just because the field
doesn't exist now doesn't mean that it won't exist later.  The field
one is sorting on doesn't even have to exist in all the documents.  I
think it would be even more confusing for an invalid query suddenly
becoming a valid query in the future just because someone added a doc
with that field indexed (esp since that doc may not even match the
query being sorted).

In short, I think sorting should act like querying (no exception if
field doesn't exist yet).

-Yonik

On 4/14/05, Daniel Naber <lucenelist@danielnaber.de> wrote:
> On Thursday 14 April 2005 16:28, Yonik Seeley wrote:
> 
> > I haven't tried it, but I think the fix should be easy... never throw
> > that exception.
> 
> As Lucene does not have the concept of a "warning" I think it should throw
> exceptions when someone tries to do something that doesn't make sense
> (even if it's technically possible). And sorting on a field that doesn't
> exist doesn't seem to make sense.
> 
> Well, searching on a field that doesn't exist won't give you an exception
> either. For debugging it would be useful if you'd get an exception instead
> of no results.
> 
> Regards
>  Daniel
> 
> --
> http://www.danielnaber.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message