Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-1345

Document type limitation of DSL generated Queries

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.0.CR1
    • Fix Version/s: 4.3.0.Final
    • Component/s: documentation, query
    • Labels:
      None

      Description

      Currently the type passed to forEntity() is not used to limit the query results to that type. This can be surprising when doing queries like this:

      Query query = queryBuilder
          .forEntity( Animal.class )
          .get()
          .all()
          .createQuery();
      

      This query will return all instances of all indexed entities instead of only Animal instances as one might expect. Instead the type has to be restricted when creating the FullTextQuery:

       fullTextSession.createFullTextQuery( query, Animal.class );
      

      The given entity type should be considered for type restriction implicitely, or there should be an option for this.

      In a first step the documentation of forEntity() should describe the behavior.

        Attachments

          Activity

            People

            • Assignee:
              gunnar.morling Gunnar Morling
              Reporter:
              gunnar.morling Gunnar Morling
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: