Example:
SphinxClient sphinxClient = new SphinxClient(); sphinxClient.SearchOptions.MatchMode = SphinxMatchMode.Extended2; sphinxClient.SearchOptions.RankMode = SphinxRankMode.Expression; sphinxClient.SearchOptions.RankingExpression = sum((4*lcs+2*(min_hit_pos==1)+exact_hit)*user_weight)*1000+bm25;
Usage example:
SphinxClient sphinxClient = new SphinxClient(); sphinxClient.Version = SphinxVersion.V202;
This change does not break any calls to the GetXXX methods of the SphinxQLDataReader class except GetValue(), depending on how the result is used.
It may break existing code in case a DataTable is used and column values are casted to their target types instead of being converted. The latter is also true if you use the GetField<T> extension methods introduced with .NET 3.5.
Examples of method calls that will not break:
long value = SphinxQLDataReader.GetInt64("my_big_int_column"); long value = Convert.ToInt64(DataTable.Rows[0].Columns["my_big_int_column"]); long value = Convert.ToInt64(SphinxQLDataReader.GetValue("my_big_int_column"));
Examples of method calls that will break:
long value = (long) SphinxQLDataReader.GetValue("my_big_int_column"); Change to: long value = SphinxQLDataReader.GetInt64("my_big_int_column"); or decimal value = (decimal) SphinxQLDataReader.GetValue("my_big_int_column"); or long value = Convert.ToInt64(SphinxQLDataReader.GetValue("my_big_int_column"); /*---------------------------------------------------------------------------*/ long value = (long) DataTable.Rows[0].Columns["my_big_int_column"]; and long value = DataTable.Rows[0].GetValue<long>("my_big_int_column"); Change to: long value = Convert.ToInt64(DataTable.Rows[0].Columns["my_big_int_column"]); or decimal value = (decimal) DataTable.Rows[0].Columns["my_big_int_column"] or decimal value = DataTable.Rows[0].GetValue<decimal>("my_big_int_column");