Examples of moreLikeThis()


Examples of org.hibernate.search.query.dsl.QueryBuilder.moreLikeThis()

    List<Object[]> entityResults;
    try {
      QueryBuilder qb = getCoffeeQueryBuilder();
      Coffee decaffInstance = getDecaffInstance( qb );
      // using fields from IndexedEmbedded
      mltQuery = qb
          .moreLikeThis()
          .comparingField( "brand.name" )
          .toEntityWithId( decaffInstance.getId() )
          .createQuery();
      entityResults = (List<Object[]>) fullTextSession
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.moreLikeThis()

      }
      outputQueryAndResults( decaffInstance, mltQuery, entityResults );

      // using indexed embedded id from document
      try {
        qb
            .moreLikeThis()
            .comparingField( "brand.id" )
            .toEntityWithId( decaffInstance.getId() )
            .createQuery();
      }
View Full Code Here

Examples of org.hibernate.search.query.dsl.QueryBuilder.moreLikeThis()

  public void testMoreLikeThisOnUnknownFieldThrowsException() {
    QueryBuilder queryBuilder = getCoffeeQueryBuilder();
    Coffee decaffInstance = getDecaffInstance( queryBuilder );

    try {
      queryBuilder.moreLikeThis()
          .comparingField( "foo" )
          .toEntityWithId( decaffInstance.getId() )
          .createQuery();
      fail( "Creating the query should have failed" );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.