I am trying to get the score value for each returned result item but the problem is all items returned the same score value. I am using sitecore 7.2 site which was upgraded from sitecore 6.6. I am using solr version 4.10.2-0
The following is the code that I am using:
var contentPredicate = PredicateBuilder.True<customSearchResultItem>();
contentPredicate = contentPredicate.And(p => p.Content.Matches(SearchKey.Boost(1.0f)));
IQueryable<SearchResultItem> query = context.GetQueryable<customSearchResultItem>().Where(contentPredicate);
var hits = query.GetResults().Hits;
foreach (var item in hits)
{
scores.Add(item.Score);
}
Would you please advise if something is missing? or if there are any configuration that should be applied to make this work?
SearchKey
values? Can you try to usep.Content.Contains
orp.Content.Like
and see whether they return different scores? – Elledge