org.springframework.data.mongodb.core.query

Class TextQuery



  • public class TextQuery
    extends Query
    Query implementation to be used to for performing full text searches.
    Since:
    1.6
    Author:
    Christoph Strobl, Mark Paluch
    • Method Detail

      • sortByScore

        public TextQuery sortByScore()
        Add sorting by text score. Will also add text score to returned fields.
        Returns:
        See Also:
        includeScore()
      • includeScore

        public TextQuery includeScore()
        Add field score holding the documents textScore to the returned fields.
        Returns:
      • includeScore

        public TextQuery includeScore(String fieldname)
        Include text search document score in returned fields using the given fieldname.
        Parameters:
        fieldname -
        Returns:
      • setScoreFieldName

        public void setScoreFieldName(String fieldName)
        Set the fieldname used for scoring.
        Parameters:
        fieldName -
      • getScoreFieldName

        public String getScoreFieldName()
        Get the fieldname used for scoring
        Returns:
      • getFieldsObject

        public org.bson.Document getFieldsObject()
        Overrides:
        getFieldsObject in class Query
        Returns:
        the field Document.
      • getSortObject

        public org.bson.Document getSortObject()
        Overrides:
        getSortObject in class Query
        Returns:
        the sort Document.