Skip to content

Commit

Permalink
Make most classes final
Browse files Browse the repository at this point in the history
  • Loading branch information
valencik committed Feb 23, 2025
1 parent c0c66d1 commit 9170e19
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/pink/cozydev/protosearch/Field.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import pink.cozydev.protosearch.analysis.Analyzer
* @param indexed Whether the field value should be indexed for fast querying
* @param positions Whether the positions should be indexed for fast phrase querying
*/
case class Field(
final case class Field(
name: String,
analyzer: Analyzer,
stored: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/pink/cozydev/protosearch/Hit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package pink.cozydev.protosearch
* @param score The score of this result given the query
* @param fields Stored fields of the result
*/
case class Hit(
final case class Hit(
val id: Int,
val score: Double,
val fields: Map[String, String],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package pink.cozydev.protosearch

case class MultiIndex(
final case class MultiIndex(
indexes: Map[String, Index],
schema: Schema,
fields: Map[String, Array[String]],
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/pink/cozydev/protosearch/Scorer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import pink.cozydev.protosearch.internal.PositionalIter

import java.util.regex.PatternSyntaxException

case class Scorer(index: MultiIndex, defaultOR: Boolean = true) {
final case class Scorer(index: MultiIndex, defaultOR: Boolean = true) {

private val defaultIdx: Index = index.indexes(index.schema.defaultField)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import pink.cozydev.lucille.QueryParser
// TODO This is a hack, the Lucille parser tokenizes on white space only currently
// We perhaps want Lucille to use a tokenizer from textmogrify
// In the meantime, we rewrite the Query with our `Analyzer`
case class QueryAnalyzer(
final case class QueryAnalyzer(
defaultField: String,
analyzers: Map[String, Analyzer],
) {
Expand Down

0 comments on commit 9170e19

Please sign in to comment.