Re: NullPointerException in FieldDocSortedHitQueue.lessThan with custom SortComparator

2009-02-02 Thread ninaS
I already found another solution: I don't use a custom SortComparator. Another solution would be to define a default value for null. Would be nice if lucene in future would be able to search by null values also if a custom SortComparator is used. To tell you more: public class MyComparator ext

Re: NullPointerException in FieldDocSortedHitQueue.lessThan with custom SortComparator

2009-02-02 Thread ninaS
That's not true: have a look at the "else"-block. The problem is that lucene's FieldDocSortedHitQueue does only test for null values if uses the type FieldDoc.STRING. With FieldDoc.CUSTOM lucene assumes ci to be never null: FieldDocSortedHitQueue 163-166: case SortField.CUSTOM:{

NullPointerException in FieldDocSortedHitQueue.lessThan with custom SortComparator

2009-01-28 Thread ninaS
Hello, I am using a custom SortComparator implementation where I need to override a method in order to handle Null values: @Override public ScoreDocComparator newComparator (final IndexReader reader, final String fieldname) throws IOException { final Strin

Re: Group by in Lucene ?

2009-01-28 Thread ninaS
By the way: if you only need to count documents (count groups) HitCollector is a good choice. If you only count you don't need to sort anything. ninaS wrote: > > Hello, > > yes I tried HitCollector but I am not satisfied with it because you can > not use sorting with Hit

Re: Group by in Lucene ?

2009-01-28 Thread ninaS
Hello, yes I tried HitCollector but I am not satisfied with it because you can not use sorting with HitCollector unless you implement a way to use TopFieldTocCollector. I did not manage to do that in a performant way. It is easier to first do a normal search und "group by" afterwards: Iterate

Re: Group by in Lucene ?

2007-12-05 Thread ninaS
Hey Marcus, have you already implemented this feature? I'm searching a group by function for lucene, too. More precisely I need it in Compass, which is built on top of lucene. I was thinking about using a HitCollector to get only one result per group. How did you do it? Cheers, Nina Marcus