Class SnippetExpression

java.lang.Object
com.google.appengine.api.search.dev.Expression
com.google.appengine.api.search.dev.SnippetExpression

public class SnippetExpression extends Expression
Expression which generates snippets from specified document.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.google.appengine.api.search.dev.Expression

    Expression.Sorter
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.apphosting.api.search.DocumentPb.FieldValue
    eval(org.apache.lucene.document.Document doc)
    Evaluate the expression to field value proto for the specified document.
    evalHtml(org.apache.lucene.document.Document doc)
     
    getSorters(int sign, double defaultValueNumeric, String defaultValueText)
    Get list of sort classes for the expression.
    static Expression
    makeSnippetExpression(String query, String fieldName, Set<com.google.apphosting.api.search.DocumentPb.FieldValue.ContentType> fieldTypes, com.google.appengine.api.search.dev.NumericExpression maxCharsExpression, com.google.appengine.api.search.dev.NumericExpression maxSnippetsExpression)
     

    Methods inherited from class com.google.appengine.api.search.dev.Expression

    makeValue

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • makeSnippetExpression

      public static Expression makeSnippetExpression(String query, String fieldName, Set<com.google.apphosting.api.search.DocumentPb.FieldValue.ContentType> fieldTypes, com.google.appengine.api.search.dev.NumericExpression maxCharsExpression, com.google.appengine.api.search.dev.NumericExpression maxSnippetsExpression)
    • evalHtml

      public String evalHtml(org.apache.lucene.document.Document doc) throws EvaluationException
      Throws:
      EvaluationException
    • eval

      public com.google.apphosting.api.search.DocumentPb.FieldValue eval(org.apache.lucene.document.Document doc) throws EvaluationException
      Description copied from class: Expression
      Evaluate the expression to field value proto for the specified document.
      Specified by:
      eval in class Expression
      Throws:
      EvaluationException
    • getSorters

      public List<Expression.Sorter> getSorters(int sign, double defaultValueNumeric, String defaultValueText)
      Description copied from class: Expression
      Get list of sort classes for the expression. Usually it contains just one element, but for field expressions it can potentially return 2 sorters when both numeric and text fields exist with a field name.
      Specified by:
      getSorters in class Expression