lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Cannot sort results with multisearcher when mismatched field names
Date Mon, 26 Sep 2005 18:33:06 GMT

I've never dealt with multisearcher's before, so i'm not sure what caveats
there are when doing Sorts with them, but you should be able to make your
own SortComparatorSource which knows about any special fields you have
that might go by multiple names, and when it's requested to sort on one of
those fields, you can check the values for either field name before doing
the comparison.

For an eample of writing your own SortComparatorSource, take a look at
this PATCH...

	http://issues.apache.org/jira/browse/LUCENE-406



: Date: Mon, 26 Sep 2005 04:16:17 -0400
: From: JMA <mrjama@comcast.net>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: Cannot  sort results with multisearcher when mismatched field
:     names
:
:
: Greetings!
: I have a relatively simple problem:
: I want to sort a set of search results by a field, say "author".
: Fine for one index, or more than one if the field "author" is the same.
:
: However, say I want to use a multisearcher (2+ indices), but the second
: index uses field name "writer".
:
: If I set a sortField array, that sorts first by author THEN writer.
: That's not what I want - I want "author" and "writer" to be treated
: as if they are the same field.
:
: I could re-index using a common field name, but would rather not.
: I could do my own custom sort after I get back the hits, but would rather
: not.
:
: Ideas?
:
: Thanks,
: JMA
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
: For additional commands, e-mail: java-user-help@lucene.apache.org
:



-Hoss


---------------------------------------------------------------------
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