<classpathentry kind="lib" path="ext/wicket-1.4.21.jar" sourcepath="ext/src/wicket-1.4.21.jar" />
<classpathentry kind="lib" path="ext/wicket-auth-roles-1.4.21.jar" sourcepath="ext/src/wicket-auth-roles-1.4.21.jar" />
<classpathentry kind="lib" path="ext/wicket-extensions-1.4.21.jar" sourcepath="ext/src/wicket-extensions-1.4.21.jar" />
- <classpathentry kind="lib" path="ext/lucene-core-4.10.0.jar" sourcepath="ext/src/lucene-core-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-analyzers-common-4.10.0.jar" sourcepath="ext/src/lucene-analyzers-common-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-highlighter-4.10.0.jar" sourcepath="ext/src/lucene-highlighter-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-memory-4.10.0.jar" sourcepath="ext/src/lucene-memory-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-queries-4.10.0.jar" sourcepath="ext/src/lucene-queries-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-queryparser-4.10.0.jar" sourcepath="ext/src/lucene-queryparser-4.10.0.jar" />
- <classpathentry kind="lib" path="ext/lucene-sandbox-4.10.0.jar" sourcepath="ext/src/lucene-sandbox-4.10.0.jar" />
+ <classpathentry kind="lib" path="ext/lucene-core-5.2.1.jar" sourcepath="ext/src/lucene-core-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-analyzers-common-5.2.1.jar" sourcepath="ext/src/lucene-analyzers-common-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-highlighter-5.2.1.jar" sourcepath="ext/src/lucene-highlighter-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-join-5.2.1.jar" sourcepath="ext/src/lucene-join-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-grouping-5.2.1.jar" sourcepath="ext/src/lucene-grouping-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-queries-5.2.1.jar" sourcepath="ext/src/lucene-queries-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-memory-5.2.1.jar" sourcepath="ext/src/lucene-memory-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-queryparser-5.2.1.jar" sourcepath="ext/src/lucene-queryparser-5.2.1.jar" />
+ <classpathentry kind="lib" path="ext/lucene-sandbox-5.2.1.jar" sourcepath="ext/src/lucene-sandbox-5.2.1.jar" />
<classpathentry kind="lib" path="ext/jakarta-regexp-1.4.jar" />
<classpathentry kind="lib" path="ext/pegdown-1.4.2.jar" sourcepath="ext/src/pegdown-1.4.2.jar" />
<classpathentry kind="lib" path="ext/parboiled-java-1.1.6.jar" sourcepath="ext/src/parboiled-java-1.1.6.jar" />
jetty.version : 9.2.10.v20150310
slf4j.version : 1.7.10
wicket.version : 1.4.21
- lucene.version : 4.10.0
+ lucene.version : 5.2.1
jgit.version : 4.0.1.201506240215-r
groovy.version : 2.4.1
bouncycastle.version : 1.51
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-core-4.10.0.jar">
+ <library name="lucene-core-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-core-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-core-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-core-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-core-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-analyzers-common-4.10.0.jar">
+ <library name="lucene-analyzers-common-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-analyzers-common-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-analyzers-common-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-analyzers-common-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-analyzers-common-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-highlighter-4.10.0.jar">
+ <library name="lucene-highlighter-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-highlighter-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-highlighter-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-highlighter-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-highlighter-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-memory-4.10.0.jar">
+ <library name="lucene-join-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-memory-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-join-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-memory-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-join-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-queries-4.10.0.jar">
+ <library name="lucene-grouping-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-queries-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-grouping-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-queries-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-grouping-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-queryparser-4.10.0.jar">
+ <library name="lucene-queries-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-queryparser-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-queries-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-queryparser-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-queries-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="lucene-sandbox-4.10.0.jar">
+ <library name="lucene-memory-5.2.1.jar">
<CLASSES>
- <root url="jar://$MODULE_DIR$/ext/lucene-sandbox-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/lucene-memory-5.2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar://$MODULE_DIR$/ext/src/lucene-sandbox-4.10.0.jar!/" />
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-memory-5.2.1.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="lucene-queryparser-5.2.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/lucene-queryparser-5.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-queryparser-5.2.1.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="lucene-sandbox-5.2.1.jar">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/ext/lucene-sandbox-5.2.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/ext/src/lucene-sandbox-5.2.1.jar!/" />
</SOURCES>
</library>
</orderEntry>
// close all writers\r
for (String writer : writers.keySet()) {\r
try {\r
- writers.get(writer).close(true);\r
+ writers.get(writer).close();\r
} catch (Throwable t) {\r
logger.error("Failed to close Lucene writer for " + writer, t);\r
}\r
String q = MessageFormat.format(pattern, SearchObjectType.blob.name(), branch, path);\r
\r
BooleanQuery query = new BooleanQuery();\r
- StandardAnalyzer analyzer = new StandardAnalyzer(LUCENE_VERSION);\r
- QueryParser qp = new QueryParser(LUCENE_VERSION, FIELD_SUMMARY, analyzer);\r
+ StandardAnalyzer analyzer = new StandardAnalyzer();\r
+ QueryParser qp = new QueryParser(FIELD_SUMMARY, analyzer);\r
query.add(qp.parse(q), Occur.MUST);\r
\r
IndexWriter writer = getIndexWriter(repositoryName);\r
IndexWriter indexWriter = writers.get(repository);\r
File repositoryFolder = FileKey.resolve(new File(repositoriesFolder, repository), FS.DETECTED);\r
File indexFolder = new File(repositoryFolder, LUCENE_DIR);\r
- Directory directory = FSDirectory.open(indexFolder);\r
+ Directory directory = FSDirectory.open(indexFolder.toPath());\r
\r
if (indexWriter == null) {\r
if (!indexFolder.exists()) {\r
indexFolder.mkdirs();\r
}\r
- StandardAnalyzer analyzer = new StandardAnalyzer(LUCENE_VERSION);\r
- IndexWriterConfig config = new IndexWriterConfig(LUCENE_VERSION, analyzer);\r
+ StandardAnalyzer analyzer = new StandardAnalyzer();\r
+ IndexWriterConfig config = new IndexWriterConfig(analyzer);\r
config.setOpenMode(OpenMode.CREATE_OR_APPEND);\r
indexWriter = new IndexWriter(directory, config);\r
writers.put(repository, indexWriter);\r
return null;\r
}\r
Set<SearchResult> results = new LinkedHashSet<SearchResult>();\r
- StandardAnalyzer analyzer = new StandardAnalyzer(LUCENE_VERSION);\r
+ StandardAnalyzer analyzer = new StandardAnalyzer();\r
try {\r
// default search checks summary and content\r
BooleanQuery query = new BooleanQuery();\r
QueryParser qp;\r
- qp = new QueryParser(LUCENE_VERSION, FIELD_SUMMARY, analyzer);\r
+ qp = new QueryParser(FIELD_SUMMARY, analyzer);\r
qp.setAllowLeadingWildcard(true);\r
query.add(qp.parse(text), Occur.SHOULD);\r
\r
- qp = new QueryParser(LUCENE_VERSION, FIELD_CONTENT, analyzer);\r
+ qp = new QueryParser(FIELD_CONTENT, analyzer);\r
qp.setAllowLeadingWildcard(true);\r
query.add(qp.parse(text), Occur.SHOULD);\r
\r
Query rewrittenQuery = searcher.rewrite(query);\r
logger.debug(rewrittenQuery.toString());\r
\r
- TopScoreDocCollector collector = TopScoreDocCollector.create(5000, true);\r
+ TopScoreDocCollector collector = TopScoreDocCollector.create(5000);\r
searcher.search(rewrittenQuery, collector);\r
int offset = Math.max(0, (page - 1) * pageSize);\r
ScoreDoc[] hits = collector.topDocs(offset, pageSize).scoreDocs;\r
*/\r
private class MultiSourceReader extends MultiReader {\r
\r
- MultiSourceReader(IndexReader [] readers) {\r
+ MultiSourceReader(IndexReader [] readers) throws IOException {\r
super(readers, false);\r
}\r
\r
private final Logger log = LoggerFactory.getLogger(getClass());
- private final Version luceneVersion = Version.LUCENE_46;
+ private final Version luceneVersion = Version.LUCENE_5_2_1;
private final File luceneDir;
public boolean deleteAll(RepositoryModel repository) {
try {
IndexWriter writer = getWriter();
- StandardAnalyzer analyzer = new StandardAnalyzer(luceneVersion);
- QueryParser qp = new QueryParser(luceneVersion, Lucene.rid.name(), analyzer);
+ StandardAnalyzer analyzer = new StandardAnalyzer();
+ QueryParser qp = new QueryParser(Lucene.rid.name(), analyzer);
BooleanQuery query = new BooleanQuery();
query.add(qp.parse(repository.getRID()), Occur.MUST);
* @return true, if deleted, false if no record was deleted
*/
private boolean delete(String repository, long ticketId, IndexWriter writer) throws Exception {
- StandardAnalyzer analyzer = new StandardAnalyzer(luceneVersion);
- QueryParser qp = new QueryParser(luceneVersion, Lucene.did.name(), analyzer);
+ StandardAnalyzer analyzer = new StandardAnalyzer();
+ QueryParser qp = new QueryParser(Lucene.did.name(), analyzer);
BooleanQuery query = new BooleanQuery();
query.add(qp.parse(StringUtils.getSHA1(repository + ticketId)), Occur.MUST);
return Collections.emptyList();
}
Set<QueryResult> results = new LinkedHashSet<QueryResult>();
- StandardAnalyzer analyzer = new StandardAnalyzer(luceneVersion);
+ StandardAnalyzer analyzer = new StandardAnalyzer();
try {
// search the title, description and content
BooleanQuery query = new BooleanQuery();
QueryParser qp;
- qp = new QueryParser(luceneVersion, Lucene.title.name(), analyzer);
+ qp = new QueryParser(Lucene.title.name(), analyzer);
qp.setAllowLeadingWildcard(true);
query.add(qp.parse(text), Occur.SHOULD);
- qp = new QueryParser(luceneVersion, Lucene.body.name(), analyzer);
+ qp = new QueryParser(Lucene.body.name(), analyzer);
qp.setAllowLeadingWildcard(true);
query.add(qp.parse(text), Occur.SHOULD);
- qp = new QueryParser(luceneVersion, Lucene.content.name(), analyzer);
+ qp = new QueryParser(Lucene.content.name(), analyzer);
qp.setAllowLeadingWildcard(true);
query.add(qp.parse(text), Occur.SHOULD);
log.debug(rewrittenQuery.toString());
- TopScoreDocCollector collector = TopScoreDocCollector.create(5000, true);
+ TopScoreDocCollector collector = TopScoreDocCollector.create(5000);
searcher.search(rewrittenQuery, collector);
int offset = Math.max(0, (page - 1) * pageSize);
ScoreDoc[] hits = collector.topDocs(offset, pageSize).scoreDocs;
}
Set<QueryResult> results = new LinkedHashSet<QueryResult>();
- StandardAnalyzer analyzer = new StandardAnalyzer(luceneVersion);
+ StandardAnalyzer analyzer = new StandardAnalyzer();
try {
- QueryParser qp = new QueryParser(luceneVersion, Lucene.content.name(), analyzer);
+ QueryParser qp = new QueryParser(Lucene.content.name(), analyzer);
Query query = qp.parse(queryText);
IndexSearcher searcher = getSearcher();
private IndexWriter getWriter() throws IOException {
if (writer == null) {
- Directory directory = FSDirectory.open(luceneDir);
+ Directory directory = FSDirectory.open(luceneDir.toPath());
if (!luceneDir.exists()) {
luceneDir.mkdirs();
}
- StandardAnalyzer analyzer = new StandardAnalyzer(luceneVersion);
- IndexWriterConfig config = new IndexWriterConfig(luceneVersion, analyzer);
+ StandardAnalyzer analyzer = new StandardAnalyzer();
+ IndexWriterConfig config = new IndexWriterConfig(analyzer);
config.setOpenMode(OpenMode.CREATE_OR_APPEND);
writer = new IndexWriter(directory, config);
}