I use solrsharp on a french XP and I have problems with the float
conversion to text.

    I modified ExempleIndexDocument constructor to force the "en-US"
culture.

    CultureInfo MyCulture = new CultureInfo("en-US");
    .
    .
    this.Add(new IndexFieldValue("weight", weight.ToString(MyCulture)));
    this.Add(new IndexFieldValue("price", price.ToString(MyCulture)));

   And I modified IndexFieldAttribute SetValue method

           CultureInfo MyCulture = new CultureInfo("en-US");

                   this.PropertyInfo.SetValue(searchRecord,
Convert.ChangeType(xnodevalue.InnerText,
                    this.PropertyInfo.PropertyType, MyCulture), null);
       ....

valueArray.SetValue(Convert.ChangeType(xnlvalues[i].InnerText, basetype,
MyCulture), i);


  Now the example runs smoothly on a windows XP french.


         Is it the right solution ??

   Thanks
 Jean-Paul




Reply via email to