lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Rojo <BryanR...@elliottelectric.com>
Subject DefaultSimilarity can no longer be set statically (and dangerously) for the entire JVM.
Date Mon, 16 Apr 2018 14:06:21 GMT


Previously I had

.Net.Search.Similarity.Default = New LuceneIgnoreSimilarity

According to the migration Guide :

LUCENE-2236<https://issues.apache.org/jira/browse/LUCENE-2236>, LUCENE-2912<https://issues.apache.org/jira/browse/LUCENE-2912>:
DefaultSimilarity can no longer be set statically (and dangerously) for the entire JVM. Similarity
can now be configured on a per-field basis (via PerFieldSimilarityWrapper) Similarity has
a lower-level API, if you want the higher-level vector-space API like in previous Lucene releases,
then look at TFIDFSimilarity.

How can I configure this per field? Any examples you would like to share?

Found this online but this method doesn't exist

IndexWriterConfig config = new IndexWriterConfig(analyzer);
config.setSimilarity(perFieldSimilarities);


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message