fixing TUSCANY-3382

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@885247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
adrianocrestani 2009-11-29 17:14:59 +00:00
parent 309409eed4
commit a9941f3ba6
4 changed files with 20 additions and 7 deletions

View file

@ -68,19 +68,19 @@
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>2.4-SNAPSHOT</version>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-highlighter</artifactId>
<version>2.4-SNAPSHOT</version>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-memory</artifactId>
<version>2.4-SNAPSHOT</version>
<version>2.9.1</version>
</dependency>
</dependencies>

View file

@ -87,7 +87,7 @@ public class DomainSearchImpl implements DomainSearch {
try {
this.dir =
new FSDirectory(new File(this.indexDirectoryPath),
FSDirectory.getDirectory(new File(this.indexDirectoryPath),
new SimpleFSLockFactory(this.indexDirectoryPath));
} catch (IOException e) {

View file

@ -29,7 +29,7 @@ import org.apache.lucene.search.highlight.Highlighter;
import org.apache.lucene.search.highlight.InvalidTokenOffsetsException;
import org.apache.lucene.search.highlight.NullFragmenter;
import org.apache.lucene.search.highlight.SimpleFragmenter;
import org.apache.lucene.search.highlight.SpanScorer;
import org.apache.lucene.search.highlight.QueryScorer;
import org.apache.tuscany.sca.domain.search.Result;
/**
@ -83,8 +83,11 @@ final public class HighlightingUtil {
CachingTokenFilter tokenStream =
new CachingTokenFilter(new DomainSearchAnalyzer().tokenStream(field, new StringReader(text)));
QueryScorer scorer = new QueryScorer(query, field, "");
scorer.init(tokenStream);
Highlighter highlighter =
new Highlighter(new DomainSearchFormatter(), new SpanScorer(query, field, tokenStream, ""));
new Highlighter(new DomainSearchFormatter(), scorer);
highlighter.setTextFragmenter(fragmenter);
tokenStream.reset();

View file

@ -125,7 +125,17 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repository>
<repository>
<id>maven2.repo</id>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>