Class NvlValueSourceParser

  • All Implemented Interfaces:
    org.apache.solr.util.plugin.NamedListInitializedPlugin

    public class NvlValueSourceParser
    extends org.apache.solr.search.ValueSourceParser
    A sample ValueSourceParser for testing. Approximates the oracle NVL function, letting you substitute a value when a "null" is encountered. In this case, null is approximated by a float value, since ValueSource always returns a float, even if the field is undefined for a document.

    Initialization parameters: - nvlFloatValue: float value to consider as "NULL" when seen in a field. defaults to 0.0f.

    Example: nvl(vs,2) will return 2 if the vs is NULL (as defined by nvlFloatValue above) or the doc value otherwise

    • Constructor Detail

      • NvlValueSourceParser

        public NvlValueSourceParser()
    • Method Detail

      • parse

        public org.apache.lucene.queries.function.ValueSource parse​(org.apache.solr.search.FunctionQParser fp)
                                                             throws org.apache.solr.search.SyntaxError
        Specified by:
        parse in class org.apache.solr.search.ValueSourceParser
        Throws:
        org.apache.solr.search.SyntaxError
      • init

        public void init​(org.apache.solr.common.util.NamedList<?> args)