Thanks Eric, I did find the problem using Luke, I see that all of the documents have the same category field, so I must not be adding the field correctly when I index them.
Bob Bob "Erick Erickson" <[EMAIL PROTECTED]> 06/27/2008 01:58 PM Please respond to java-user@lucene.apache.org To java-user@lucene.apache.org cc Subject Re: Sorting issues I can't really help since I've never had to go into the guts of Lucene and see where sorting is applied, so I don't know where to point you <G>. But the sorting has always worked for me, and I don't remember anyone else posting a similar issue in the last year or so. Which means that the first thing I'd suspect is that something in your code. Which is why it would be helpful if you'd post some code snippets showing 1> how you index your field 2> how you construct your sort object 3> how you search using your sort object Best Erick On Fri, Jun 27, 2008 at 2:46 PM, <[EMAIL PROTECTED]> wrote: > Actually, I do a global search and the order comes out: 1, 2, 8, 3, 5, 6, > 7,8, 4, 9. I'm having trouble finding in the code where the sort actually > gets applied. Can you help me out there? > > Bob > > > > > "Erick Erickson" <[EMAIL PROTECTED]> > 06/27/2008 12:19 PM > Please respond to > java-user@lucene.apache.org > > > To > java-user@lucene.apache.org > cc > > Subject > Re: Sorting issues > > > > > > > That's surprising. Could you post a brief example of your > index and search code? > > It sounds like you're saying > docs 1, 2, 3 all have category aaa > docs 4, 5, 6 all have category bbb > docs 7, 8, 9 all have category ccc > > But if you search for category:bbb > you don't get docs 4, 5, and 6 > > Is this a fair statement of the issue? > > Best > Erick > > > On Fri, Jun 27, 2008 at 11:44 AM, <[EMAIL PROTECTED]> wrote: > > > I just implemented a sorting feature on our application where the user > can > > change the sort on a query and reexecute the search. It works fine on > > text fields where most of the documents have different field values. > > However, on fields that are categories, that is, there are only four > > distinct values for the category field and > > all of the documents fit into a distinct category, the results are not > in > > the sorted values. > > > > All of the sort fields are untokenized and stored. and each document has > > only one value for the sorted field. > > > > Are there any known issues (Lucene 2.3.0)? How can I go about debugging > > this? I have tried Luke, also I have the Lucene source. > > > > Bob Hastings > > Ancept Inc. > >