Class TextQuery

java.lang.Object
com.redis.vl.query.TextQuery

public class TextQuery extends Object
Full-text search query
  • Constructor Details

    • TextQuery

      public TextQuery(String text, String textField, String scorer, List<String> returnFields)
      Create a text query without a filter expression.
      Parameters:
      text - The text to search for
      textField - The field to search in
      scorer - The scoring algorithm (e.g., "BM25", "TF IDF")
      returnFields - List of fields to return in results
    • TextQuery

      public TextQuery(String text, String textField, String scorer, Filter filterExpression, List<String> returnFields)
      Create a text query with all parameters.
      Parameters:
      text - The text to search for
      textField - The field to search in
      scorer - The scoring algorithm
      filterExpression - Optional filter to apply
      returnFields - List of fields to return in results
  • Method Details

    • getText

      public String getText()
      Get the search text
      Returns:
      Search text
    • getTextField

      public String getTextField()
      Get the text field to search in
      Returns:
      Text field name
    • getScorer

      public String getScorer()
      Get the scoring algorithm
      Returns:
      Scorer name
    • getFilterExpression

      public Filter getFilterExpression()
      Get the filter expression
      Returns:
      Filter expression or null
    • getReturnFields

      public List<String> getReturnFields()
      Get the return fields
      Returns:
      List of fields to return or null
    • toQueryString

      public String toQueryString()
      Build the query string for Redis text search
      Returns:
      Query string
    • toString

      public String toString()
      Overrides:
      toString in class Object