Class OLuceneSearchOnFieldsFunction

All Implemented Interfaces:
OIndexableSQLFunction, OSQLFunction

public class OLuceneSearchOnFieldsFunction extends OLuceneSearchFunctionTemplate
Created by frank on 15/01/2017.
  • Field Details

  • Constructor Details

    • OLuceneSearchOnFieldsFunction

      public OLuceneSearchOnFieldsFunction()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: OSQLFunction
      Function name, the name is used by the sql parser to identify a call this function.
      Specified by:
      getName in interface OSQLFunction
      Overrides:
      getName in class OSQLFunctionAbstract
      Returns:
      String , function name, never null or empty.
    • execute

      public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] params, OCommandContext ctx)
      Description copied from interface: OSQLFunction
      Process a record.
      iCurrentRecord - : current record
      iCurrentResult - TODO
      params - : function parameters, number is ensured to be within minParams and maxParams.
      ctx - : object calling this function
      Returns:
      function result, can be null. Special cases : can be null if function aggregate results, can be null if function filter results : this mean result is excluded
    • getSyntax

      public String getSyntax()
      Description copied from interface: OSQLFunction
      Returns a convenient SQL String representation of the function.

      Example :

        myFunction( param1, param2, [optionalParam3])
       

      This text will be used in exception messages.

      Returns:
      String , never null.
    • searchFromTarget

      public Iterable<OIdentifiable> searchFromTarget(OFromClause target, OBinaryCompareOperator operator, Object rightValue, OCommandContext ctx, OExpression... args)
      Description copied from interface: OIndexableSQLFunction
      returns all the entries belonging to the target that match the binary condition where this function appears
      Parameters:
      target - the query target
      operator - the operator after the function, eg. in select from Foo where myFunction(name) > 4 the operator is >
      rightValue - the value that has to be compared to the function result, eg. in select from Foo where myFunction(name) > 4 the right value is 4
      ctx - the command context for this query
      args - the function arguments, eg. in select from Foo where myFunction(name) > 4 the arguments are [name]
      Returns:
      an iterable of records that match the condition; null means that the execution could not be performed for some reason.
    • searchForIndex

      protected OLuceneFullTextIndex searchForIndex(OFromClause target, OCommandContext ctx, OExpression... args)
      Specified by:
      searchForIndex in class OLuceneSearchFunctionTemplate
    • intersection

      public <T> List<T> intersection(List<T> list1, List<T> list2)
    • intersect

      public <T> boolean intersect(List<T> list1, List<T> list2)