Fix linting warnings

This commit is contained in:
2020-08-22 05:11:59 +02:00
parent bad5322abd
commit eeae982a71
19 changed files with 47 additions and 54 deletions
-2
View File
@@ -6,8 +6,6 @@ import org.apache.lucene.document.Document
import org.apache.lucene.document.Field
import org.apache.lucene.document.StringField
import org.apache.lucene.document.TextField
import org.apache.lucene.search.IndexSearcher
import org.apache.lucene.search.TopDocs
internal fun PersistedNote.toDocument(): Document {
val note = this
@@ -1,7 +1,6 @@
package be.simplenotes.search
import be.simplenotes.domain.model.PersistedNote
import be.simplenotes.domain.model.PersistedNoteMetadata
import be.simplenotes.domain.usecases.search.NoteSearcher
import be.simplenotes.domain.usecases.search.SearchTerms
import be.simplenotes.search.utils.rmdir
@@ -96,5 +95,4 @@ class NoteSearcherImpl(basePath: Path = Path.of("/tmp", "lucene")) : NoteSearche
override fun dropIndex(userId: Int) = rmdir(File(baseFile, userId.toString()).toPath())
override fun dropAll() = rmdir(baseFile.toPath())
}
@@ -63,7 +63,7 @@ internal class NoteSearcherImplTest {
* small RAM requirements -- only 1MB heap
* incremental indexing as fast as batch indexing
* index size roughly 20-30% the size of text indexed
""".trimIndent()
""".trimIndent()
// endregion
@Test
@@ -85,6 +85,7 @@ internal class NoteSearcherImplTest {
index("second")
index("flip")
@Suppress("SpellCheckingInspection")
assertThat(search("firt"))
.hasSizeGreaterThanOrEqualTo(1)
.anyMatch { it.title == "first" }