Try our conversational search powered by Generative AI!

Searching: IndexResponseItem.Score is always 0


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


return query;

Jul 29, 2016 13:25

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. 

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.