lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r594406 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PrefixQuery.cs
Date Tue, 13 Nov 2007 03:07:44 GMT
Author: aroush
Date: Mon Nov 12 19:07:44 2007
New Revision: 594406

URL: http://svn.apache.org/viewvc?rev=594406&view=rev
Log:
Use "StringComparison.Ordina" for String.StartsWith() (on .NET 2.0) to match prefix based
on culture setting.

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PrefixQuery.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PrefixQuery.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Search/PrefixQuery.cs?rev=594406&r1=594405&r2=594406&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PrefixQuery.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Search/PrefixQuery.cs Mon Nov 12 19:07:44
2007
@@ -56,8 +56,12 @@
 				do 
 				{
 					Term term = enumerator.Term();
-					if (term != null && term.Text().StartsWith(prefixText) && term.Field()
== prefixField)
-					{
+#if !FRAMEWORK_1_1
+                    if (term != null && term.Text().StartsWith(prefixText, StringComparison.Ordinal)
&& term.Field() == prefixField)
+#else
+                    if (term != null && term.Text().StartsWith(prefixText) &&
term.Field() == prefixField)
+#endif
+                    {
 						TermQuery tq = new TermQuery(term); // found a match
 						tq.SetBoost(GetBoost()); // set the boost
 						query.Add(tq, BooleanClause.Occur.SHOULD); // add to query



Mime
View raw message