Skip to content

Commit

Permalink
HSEARCH-2467 Test that Jest now serializes longs in numeric range que…
Browse files Browse the repository at this point in the history
…ries correctly

Fix in Jest: searchbox-io/Jest#422
  • Loading branch information
yrodiere authored and Sanne committed Dec 19, 2016
1 parent 3047ca2 commit c3656e4
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -17,6 +17,8 @@
import java.util.Locale;
import java.util.TimeZone;

import org.apache.lucene.search.NumericRangeQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.hibernate.ScrollableResults;
Expand Down Expand Up @@ -186,6 +188,23 @@ public void testNumericFieldQuery() throws Exception {
s.close();
}

@Test
@TestForIssue(jiraKey = "HSEARCH-2467")
public void testDateFieldRangeQuery() throws Exception {
Session s = openSession();
FullTextSession session = Search.getFullTextSession( s );
Transaction tx = s.beginTransaction();

Query query = NumericRangeQuery.newLongRange( "dateOfBirth", -373078800000L, null, true, true );
List<?> result = session.createFullTextQuery( query, GolfPlayer.class )
.setSort( new Sort( new SortField( "id", SortField.Type.STRING ) ) )
.list();

assertThat( result ).onProperty( "firstName" ).containsOnly( "Klaus" );
tx.commit();
s.close();
}

@Test
public void testEmbeddedIndexing() throws Exception {
Tower tower = new Tower();
Expand Down

0 comments on commit c3656e4

Please sign in to comment.