title: Hibernate Search. Exclusion from indexing records with specific properties
body: <p>I have two entites, Book:</p>
  
  <pre><code>@Entity
  @Indexed
  public class Book extends BaseEntity {
  @Field
  @Analyzer(definition = "customanalyzer")
  private String subtitle;
  private boolean prohibited;
  
  @DateBridge(resolution = Resolution.DAY)
  private Date publicationDate;
  
  @IndexedEmbedded
  @ManyToMany(fetch = FetchType.EAGER)
  @Cascade(value = {CascadeType.ALL})
  private List&lt;Author&gt; authors = new ArrayList&lt;Author&gt;();
  
  public Book() {
  }
  </code></pre>
  
  <p>and Author</p>
  
  <pre><code>@Entity
  @Indexed
  @Analyzer(impl = EnglishAnalyzer.class)
  public class Author extends Identifiable&lt;Long&gt; {
  @Field
  private String name;
  </code></pre>
  
  <p>I must find only that the author whose book is not prohibited. If I invoke that query </p>
  
  <pre><code>QueryBuilder qb = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity(c).get();
      Query luceneQuery = qb
              .keyword()
              .fuzzy()
              .onFields("name")
              .matching(q)
              .createQuery();
  
      FullTextQuery createFullTextQuery = fullTextSession.createFullTextQuery(luceneQuery, Author.class);
  </code></pre>
  
  <p>The question is, how can I understand what the author of the book is prohibited? Maybe something like a query, you can add a condition to the search was only in those books that are not banned? Or how to do something so that luсene not index forbidden books?</p>