Can somebody take a look in why I'm not getting the correct alphabetical
order?
I changed last_name field to be 'UN_TOKENIZED' and sorting on only last
name, then network status. But with last name as 'J' in query, I am getting
results like:
JACOBSON
JOHNSON
JAHN
I would expect 'JAHN' to come before 'johnson'.
can somebody suggest wht's going wrong here.
Vanshi
vanshi wrote:
>
> I am doing custom sorting within lucene using overloaded
> searcher.search(query, sort). First precedence is to sort based on 'last
> name' and then on 'network status', where 'INN' is better than 'OUT'.
>
> Fields are stored in the indexes like this:
>
> FIRST_NAME(Field.Store.NO, Field.Index.NO_NORMS)
> LAST_NAME_EXACT(Field.Store.NO, Field.Index.NO_NORMS)
>
> And analyzer used is 'keyword analyzer' on these fields. And the fields
> are sorted with following lines.
>
> ArrayList<SortField> sorts = new ArrayList<SortField>();
> sorts.add(new SortField("LAST_NAME_EXACT"));
> sorts.add(new SortField(ProviderFieldInfo.NETWORK.toString(),
> networkComparatorSource));
> super.setSort(sorts.toArray(new SortField[sorts.size()]));
>
> Now, with the above line my expectation is to see 'last name' sorted
> alphabatically and then if two 'last names' are same then 'network
> status(INN/OUT)' must get precedence and if both 'network status' and
> 'last name' are same then socre will decide the order. Is this expectation
> wrong??
>
> The result I'm getting is in this order: The query used is a prefix query,
> where 'last name' entered is 'john' and first name is 'p'.
>
> JOHNSON, PETER A INN
> JOHNSON, PETER B INN
> JOHNSON, PEGGY A OUT
> JOHNSON, PHILLIP W INN
> JOHNSON-STUHR, PAMELA J OUT
> JOHN, P G INN
> JOHNSON, PAUL G INN
> JOHNSON, PETER R INN
>
> Can somebody take alook and see what should be done to get expected
> results?
>
> Thanks,
> Vanshi
>
>
--
View this message in context:
http://www.nabble.com/Custom-sorting%21-tp23876641p23888815.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]