lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Curtin" <>
Subject Re: Boosting Fields (in index) or Queries
Date Fri, 14 Apr 2006 19:43:06 GMT
Jeremy Hanna wrote:

> I would use a database function to force the ordering like the one  your 
> provided that works in Oracle, but it doesn't look like mysql 5  
> supports that.  If anyone else knows of a way to force the ordering  
> using mysql 5 queries, please respond.  I think I'll just resort them  
> when they get back though.

If there's nothing in the relational table that specifies the ordering, I'm 
afraid you've probably got similar problems in other places.  RDBMSes don't 
guarantee to return rows in the order they were INSERTed.  Sure, early in the 
life of a table that will tend to happen, but as DELETEs, then UPDATEs and new 
INSERTs get processed, the on-disk order tends to get pretty jumbled.  Note 
that I'm talking about anything that uses the results of your SELECT, not just 
your Lucene-related code.

If ordering of the rows is something your app needs, I recommend adding a 
column that is expressly for ordering.  A one-up integer or something like 
that.  I don't remember what the keyword in MySQL is for that, but I'm pretty 
sure there is one.  Then you can code all your SELECTs with an ORDER BY clause 
that does what you want.

Good luck!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message