lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: custom sort
Date Wed, 09 Aug 2006 23:41:34 GMT

what you want is not a customized sort as much as a customized Score ..
scores can be customized by modifying your Similarity, class -- LIA has
some good info on this, but the best way to figure out what you want may
be to start by creating your own Similarity class and then look at the
search.explain output for your searches to understand how your changes
affect things.

: Date: Wed, 9 Aug 2006 13:46:30 +0200
: From: Enrique Lamas <>
: Reply-To:
: To:
: Subject: custom sort
: Hi,
: I want to execute a query searching a few terms
: QueryParser queryParser = new MultiFieldQueryParser(new String[] {"tags", "title"}, ProcessConstants.analyzer);
: Query query = queryParser.parse("rocio ortega");
: and I want to obtain the results sorted by the number of founded terms, but not considering
other factors like the number of times found each term. ¿How can I do this?
: SortField.FIELD_SCORE doesn´t work for this because I think it consider other factors like
the number of times found each term.
: Thanks


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

View raw message