mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Remove deprecated API
(cherry picked from commit 20ba179e0d555063b1459489f07c883519aa208d) (cherry picked from commit 488eefe185b0fe45e8839fade7631f05c6b25ddc) IJ-MR-166587 GitOrigin-RevId: e37799dfe287df9fcd8f9abb976fefc3a3700e83
This commit is contained in:
committed by
intellij-monorepo-bot
parent
61aefb5cde
commit
f6623b4def
@@ -31,11 +31,11 @@ internal fun buildHelpPlugin(pluginVersion: String, context: BuildContext): Plug
|
||||
spec.directoryName = "${productName.replace(" ", "")}Help"
|
||||
spec.excludeFromModule(BUILT_IN_HELP_MODULE_NAME, "com/jetbrains/builtInHelp/indexer/**")
|
||||
spec.withPatch { patcher, buildContext ->
|
||||
patcher.patchModuleOutput(
|
||||
/* patcher.patchModuleOutput(
|
||||
moduleName = BUILT_IN_HELP_MODULE_NAME,
|
||||
path = "META-INF/services/org.apache.lucene.codecs.Codec",
|
||||
content = "org.apache.lucene.codecs.lucene50.Lucene50Codec"
|
||||
)
|
||||
)*/
|
||||
patcher.patchModuleOutput(
|
||||
moduleName = BUILT_IN_HELP_MODULE_NAME,
|
||||
path = "META-INF/plugin.xml",
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.apache.lucene.analysis.standard.StandardAnalyzer
|
||||
import org.apache.lucene.index.DirectoryReader
|
||||
import org.apache.lucene.queryparser.simple.SimpleQueryParser
|
||||
import org.apache.lucene.search.IndexSearcher
|
||||
import org.apache.lucene.search.TopScoreDocCollector
|
||||
import org.apache.lucene.search.TopScoreDocCollectorManager
|
||||
import org.apache.lucene.search.highlight.Highlighter
|
||||
import org.apache.lucene.search.highlight.QueryScorer
|
||||
import org.apache.lucene.search.highlight.Scorer
|
||||
@@ -59,17 +59,18 @@ class HelpSearch {
|
||||
reader = DirectoryReader.open(indexDirectory)
|
||||
|
||||
val searcher = IndexSearcher(reader)
|
||||
val collector: TopScoreDocCollector = TopScoreDocCollector.create(maxHits, maxHits)
|
||||
val q = SimpleQueryParser(analyzer, mapOf(Pair("contents", 1.0F), Pair("title", 1.5F))).parse(query)
|
||||
searcher.search(q, collector)
|
||||
val hits = collector.topDocs().scoreDocs
|
||||
val q = SimpleQueryParser(analyzer, mapOf(Pair("contents", 1.0F),
|
||||
Pair("title", 1.5F))).parse(query)
|
||||
val hits = searcher.search(q,
|
||||
TopScoreDocCollectorManager(maxHits, maxHits))
|
||||
|
||||
val scorer: Scorer = QueryScorer(q)
|
||||
val highlighter = Highlighter(scorer)
|
||||
|
||||
val results = ArrayList<HelpSearchResult>()
|
||||
for (i in hits.indices) {
|
||||
val doc = searcher.doc(hits[i].doc)
|
||||
val results = mutableListOf<HelpSearchResult>()
|
||||
|
||||
for (i in hits.scoreDocs.indices) {
|
||||
val doc = searcher.storedFields().document(hits.scoreDocs[i].doc)
|
||||
val contentValue = buildString {
|
||||
append(highlighter.getBestFragment(
|
||||
analyzer, "contents", doc.get("contents")
|
||||
|
||||
Reference in New Issue
Block a user