Skip to content

Commit

Permalink
HSEARCH-2434 Fix some tests to make them work with ES5 too
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Mar 21, 2017
1 parent 9e12b55 commit 21539c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public void property_attribute_leniency() throws Exception {
+ "'myField': {"
+ "'type': 'long',"
+ "'index': true,"
+ "'store': 'yes'"
+ "'store': true"
+ "}"
+ "}"
+ "}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public void testQueryStringQuery() throws Exception {
query = ElasticsearchQueries.fromQueryString( "abstract:important OR title:important" );
result = session.createFullTextQuery( query, ResearchPaper.class ).list();

assertThat( result ).onProperty( "title" ).containsExactly(
assertThat( result ).onProperty( "title" ).containsOnly(
"Very important research on Hibernate",
"Some research"
);
Expand Down Expand Up @@ -588,7 +588,7 @@ public void testProjection() throws Exception {
Object[] projection = (Object[]) result.iterator().next();
assertThat( projection[0] ).describedAs( "id" ).isEqualTo( 1L );
assertThat( projection[1] ).describedAs( "object class" ).isEqualTo( GolfPlayer.class );
assertThat( projection[2] ).describedAs( "score" ).isEqualTo( 0.30685282F );
assertThat( projection[2] ).describedAs( "score" ).isInstanceOf( Float.class );
assertThat( projection[3] ).describedAs( "this" ).isInstanceOf( GolfPlayer.class );
assertThat( ( (GolfPlayer) projection[3] ).getId() ).isEqualTo( 1L );
assertThat( projection[4] ).describedAs( "firstName" ).isEqualTo( "Klaus" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Fields;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.SortableField;

/**
* @author Richard Hallier
Expand All @@ -32,6 +33,7 @@ public class ScientificArticle {
@Field(name = "title", analyze = Analyze.NO),
@Field(name = "titleAnalyzed")
})
@SortableField(forField = "title")
private String title;

@Field(name = "abstract")
Expand Down

0 comments on commit 21539c6

Please sign in to comment.