November Happy Hour will be moved to Thursday December 5th.

Searching: IndexResponseItem.Score is always 0

Vote:
 

I'm trying to boost a query on certain fields but the value of the score property of my IndexresponseItems is set  zero. 

I found this post by Anders Hattestad,  but unfortunatley that didn't seem to be the problem in my case. 

Here's what my query looks like: 

 var query = new GroupQuery(LuceneOperator.AND);

if (!string.IsNullOrWhiteSpace(searchQuery.SearchText))
{
  var searchTextQuery = new GroupQuery(LuceneOperator.OR);
  searchTextQuery.QueryExpressions.Add(new TermBoostQuery(searchQuery.SearchText, Field.Title, 1F));
  searchTextQuery.QueryExpressions.Add(new TermBoostQuery(searchQuery.SearchText, Field.Modified, 0.8F));
  searchTextQuery.QueryExpressions.Add(new TermBoostQuery(searchQuery.SearchText, Field.DisplayText, 0.5F));

  searchTextQuery.QueryExpressions.Add(new FieldQuery(searchQuery.SearchText, Field.Title));

  query.QueryExpressions.Add(searchTextQuery);
}

return query;

#151583
Jul 29, 2016 13:25
Vote:
 

Okay, maybe it was the problem after all. It works if I set the current thread to Invariant.Cutlture ( Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("iv")); before building my query. Is this the way to go, or does anyone have a better solution? Right now it seems like a hackish solution. 

#151584
Jul 29, 2016 13:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.