Closed iilyak closed 9 months ago
In the description, items 1-2 and 4-5 seem to be the same, except for the formatting.
The mango-test
and elixir-search
targets work with recent CouchDB main
. However, in the meantime I have fixed the previously mischievous Mango integration test case that tried to pass the default analyzer as a list of strings.
In the description, items 1-2 and 4-5 seem to be the same, except for the formatting.
I removed duplication in the description of the PR
Refactor
createAnalyzer
to remove polymorphic arguments and useMap[String, Any]
The polymorphism makes it harder to introduce types. Because it requires union types. Which are not natively supported by the version of Scala we use. Elimination of the polymorphism would allow us to introduce types.
The introduction of types is the vehicle to solve type erasure problem we would have to deal with when we upgrade Scala to the next version.
The refactoring is done using following steps
AnalyzerOptions
class with type specific constructorsdef fromMap(map: Map[_, _])
def fromAnalyzerName(name: String)
def fromKVsList(options: List[_])
Any
to the concrete type. This PR uses the.collect
combinator instead of relying onClassCastException
.Assumptions
options
passed toOpenIndexMsg
are strings.options
.String
or a singleString
element wrapped in theList
.stopwords
is a list.(String, String)
or(String, [String])
.String
in('analyze, config, text)
message inAnalyzerService.handleCall
and it should really be named('analyze, analyzerName, text)
.