org.hibernate.search.exception.SearchException: HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities.

Hibernate JIRA | Sanne Grinovero | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    The Query Validation is not allowing a Numeric RangeQuery on an id field even if it's being encoded as a {{@NumericField}} {noformat}org.hibernate.search.exception.SearchException: HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities. at org.hibernate.search.query.engine.impl.LazyQueryState.validateQuery(LazyQueryState.java:154) at org.hibernate.search.query.engine.impl.LazyQueryState.search(LazyQueryState.java:98) at org.hibernate.search.query.engine.impl.QueryHits.updateTopDocs(QueryHits.java:250) at org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:145) at org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:114) at org.hibernate.search.query.engine.impl.HSQueryImpl.getQueryHits(HSQueryImpl.java:452) at org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:268) at org.hibernate.search.test.id.NumericIdEncodingTest.expectedProjections(NumericIdEncodingTest.java:62) {noformat} {code}@Indexed public class Staff { @DocumentId @NumericField final Long id; @Field(store = Store.YES) final String name; Staff(long id, String name) { this.id = id; this.name = name; } } {code}

    Hibernate JIRA | 2 years ago | Sanne Grinovero
    org.hibernate.search.exception.SearchException: HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities.
  2. 0

    The Query Validation is not allowing a Numeric RangeQuery on an id field even if it's being encoded as a {{@NumericField}} {noformat}org.hibernate.search.exception.SearchException: HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities. at org.hibernate.search.query.engine.impl.LazyQueryState.validateQuery(LazyQueryState.java:154) at org.hibernate.search.query.engine.impl.LazyQueryState.search(LazyQueryState.java:98) at org.hibernate.search.query.engine.impl.QueryHits.updateTopDocs(QueryHits.java:250) at org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:145) at org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:114) at org.hibernate.search.query.engine.impl.HSQueryImpl.getQueryHits(HSQueryImpl.java:452) at org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:268) at org.hibernate.search.test.id.NumericIdEncodingTest.expectedProjections(NumericIdEncodingTest.java:62) {noformat} {code}@Indexed public class Staff { @DocumentId @NumericField final Long id; @Field(store = Store.YES) final String name; Staff(long id, String name) { this.id = id; this.name = name; } } {code}

    Hibernate JIRA | 2 years ago | Sanne Grinovero
    org.hibernate.search.exception.SearchException: HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities.

    Root Cause Analysis

    1. org.hibernate.search.exception.SearchException

      HSEARCH000232: The specified query 'id:{1 TO 3}' contains a numeric sub query which targets the string encoded field(s) 'id'. Check your query or try limiting the targeted entities.

      at org.hibernate.search.query.engine.impl.LazyQueryState.validateQuery()
    2. Hibernate Search Engine
      HSQueryImpl.queryEntityInfos
      1. org.hibernate.search.query.engine.impl.LazyQueryState.validateQuery(LazyQueryState.java:154)
      2. org.hibernate.search.query.engine.impl.LazyQueryState.search(LazyQueryState.java:98)
      3. org.hibernate.search.query.engine.impl.QueryHits.updateTopDocs(QueryHits.java:250)
      4. org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:145)
      5. org.hibernate.search.query.engine.impl.QueryHits.<init>(QueryHits.java:114)
      6. org.hibernate.search.query.engine.impl.HSQueryImpl.getQueryHits(HSQueryImpl.java:452)
      7. org.hibernate.search.query.engine.impl.HSQueryImpl.queryEntityInfos(HSQueryImpl.java:268)
      7 frames
    3. org.hibernate.search
      NumericIdEncodingTest.expectedProjections
      1. org.hibernate.search.test.id.NumericIdEncodingTest.expectedProjections(NumericIdEncodingTest.java:62)
      1 frame