Add local namespace searching.
This commit is contained in:
parent
8fa798cf63
commit
8a05fc8966
@ -49,13 +49,25 @@ class SearchEngine {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Match namespace
|
if(component.tag!!.components.size > 0) {
|
||||||
val ns = metadata.tags.entries.asSequence().filter {
|
//Match namespace
|
||||||
it.key == component.namespace
|
val ns = metadata.tags.entries.asSequence().filter {
|
||||||
}.flatMap { it.value.asSequence() }
|
it.key == component.namespace
|
||||||
//Match tags
|
}.flatMap { it.value.asSequence() }
|
||||||
if (!matchTagList(ns, component.tag!!))
|
//Match tags
|
||||||
return false
|
if (!matchTagList(ns, component.tag!!))
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
//Perform namespace search
|
||||||
|
val hasNs = metadata.tags.entries.find {
|
||||||
|
it.key == component.namespace
|
||||||
|
} != null
|
||||||
|
|
||||||
|
if(hasNs && component.excluded)
|
||||||
|
return false
|
||||||
|
else if(!hasNs && !component.excluded)
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,9 +99,10 @@ class SearchEngine {
|
|||||||
|
|
||||||
fun flushAll() {
|
fun flushAll() {
|
||||||
flushText()
|
flushText()
|
||||||
if (queuedText.isNotEmpty()) {
|
if (queuedText.isNotEmpty() || namespace != null) {
|
||||||
val component = namespace?.apply {
|
val component = namespace?.apply {
|
||||||
tag = flushToText()
|
tag = flushToText()
|
||||||
|
namespace = null
|
||||||
} ?: flushToText()
|
} ?: flushToText()
|
||||||
component.excluded = nextIsExcluded
|
component.excluded = nextIsExcluded
|
||||||
component.exact = nextIsExact
|
component.exact = nextIsExact
|
||||||
|
Loading…
x
Reference in New Issue
Block a user