org.apache.lucene.search.similarities

## Class RandomSimilarity

- java.lang.Object
- - org.apache.lucene.search.similarities.Similarity
  - - org.apache.lucene.search.similarities.PerFieldSimilarityWrapper
    - - org.apache.lucene.search.similarities.RandomSimilarity

-     public class RandomSimilarity
      extends PerFieldSimilarityWrapper

  Similarity implementation that randomizes Similarity implementations per-field.

  The choices are 'sticky', so the selected algorithm is always used for the same field.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.search.similarities.Similarity

      `Similarity.SimScorer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomSimilarity(Random random)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Similarity` | `get(String field)`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.lucene.search.similarities.PerFieldSimilarityWrapper

      `computeNorm, scorer`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RandomSimilarity

          public RandomSimilarity(Random random)

  - ### Method Detail

    - #### get

          public Similarity get(String field)

      Specified by:
        `get` in class `PerFieldSimilarityWrapper`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.