Upgrading to Lucene.Net 2.9.4.1

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-12-02 11:12:24 -08:00
parent 72f196e6e2
commit 5fc8b09ba1
6 changed files with 21223 additions and 20960 deletions

View File

@@ -1,3 +1,4 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
@@ -202,10 +203,10 @@
Some code in src/java/org/apache/lucene/util/UnicodeUtil.java was
derived from unicode conversion examples available at
http://www.unicode.org/Public/PROGRAMS/CVTUTF. Here is the copyright
from those sources:
Some code in src/Lucene.Net/Util/UnicodeUtil.cs was derived from unicode
conversion examples available at http://www.unicode.org/Public/PROGRAMS/CVTUTF.
Here is the copyright from those sources:
/*
* Copyright 2001-2004 Unicode, Inc.
@@ -230,10 +231,41 @@ from those sources:
*/
Some code in src/java/org/apache/lucene/util/ArrayUtil.java was
derived from Python 2.4.2 sources available at
http://www.python.org. Full license is here:
Some code in src/Lucene.Net/Util/ArrayUtil.cs was derived from Python 2.4.2
sources available at http://www.python.org.
Full license is here:
http://www.python.org/download/releases/2.4.2/license/
The following license applies to the Snowball's Portuguese, Hungarian, Romanian, Turkish stemmers:
Copyright (c) 2001, Dr Martin Porter
Copyright (c) 2002, Richard Boulton
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holders nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

1
lib/lucene.net/patch.txt Normal file
View File

@@ -0,0 +1 @@
This is a modified version including a [assembly: SecutiryTransparent] attribute in AssemblyInfo.cs

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Lucene.Models;
using Lucene.Net.Index;
@@ -166,7 +167,9 @@ namespace Lucene.Services {
return;
}
if (_boost != 0) {
// comparing floating-point numbers using an epsilon value
const double epsilon = 0.001;
if (Math.Abs(_boost - 0) > epsilon) {
_query.SetBoost(_boost);
}
@@ -312,7 +315,7 @@ namespace Lucene.Services {
Logger.Debug("Searching: {0}", query.ToString());
searcher.Search(query, collector);
var results = collector.TopDocs().scoreDocs
var results = collector.TopDocs().ScoreDocs
.Skip(_skip)
.Select(scoreDoc => new LuceneSearchHit(searcher.Doc(scoreDoc.doc), scoreDoc.score))
.ToList();
@@ -342,8 +345,8 @@ namespace Lucene.Services {
try {
var hits = searcher.Search(query, Int16.MaxValue);
Logger.Information("Search results: {0}", hits.scoreDocs.Length);
var length = hits.scoreDocs.Length;
Logger.Information("Search results: {0}", hits.ScoreDocs.Length);
var length = hits.ScoreDocs.Length;
return Math.Min(length - _skip, _count);
}
finally {
@@ -353,13 +356,13 @@ namespace Lucene.Services {
}
public ISearchHit Get(int documentId) {
var query = new TermQuery(new Term("id", documentId.ToString()));
var query = new TermQuery(new Term("id", documentId.ToString(CultureInfo.InvariantCulture)));
var searcher = new IndexSearcher(_directory, true);
try {
var hits = searcher.Search(query, 1);
Logger.Information("Search results: {0}", hits.scoreDocs.Length);
return hits.scoreDocs.Length > 0 ? new LuceneSearchHit(searcher.Doc(hits.scoreDocs[0].doc), hits.scoreDocs[0].score) : null;
Logger.Information("Search results: {0}", hits.ScoreDocs.Length);
return hits.ScoreDocs.Length > 0 ? new LuceneSearchHit(searcher.Doc(hits.ScoreDocs[0].doc), hits.ScoreDocs[0].score) : null;
}
finally {
searcher.Close();