Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8678475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:43:51+00:00 2026-06-12T20:43:51+00:00

I have a Hibernate Search entity class that looks something like this: @Entity @Indexed

  • 0

I have a Hibernate Search entity class that looks something like this:

@Entity
@Indexed
@FullTextFilterDefs({
   @FullTextFilterDef(name="myFilter", impl=MyFilterFactory.class)
})
public class Parent {
   ...
   @Column
   @Field
   private String name;

   @ManyToMany
   @IndexedEmbedded
   private Set<Child> children;
   ...
}

The associated enity is likewise straightforward:

@Entity
@Indexed
public class Child {
   ...
   @Column
   @Field
   private String name;

   @ManyToMany(mappedBy="children")
   @ContainedIn
   private Set<Parent> parents;
   ...
}

If the MyFilterFactory.getFilter() method is working with a simple field of Parent like this (hardcoded for easier illustration):

...
Term term = new Term("name", "daddy");
Query query = new TermQuery(term);
return new CachingWrapperFilter( new QueryWrapperFilter(query) );
...

… then FullTextQuery‘s with this filter enabled work as expected.

However, if I change the filter to use a field of an embedded field:

...
Term term = new Term("children.name", "Junior");
Query query = new TermQuery(term);
return new CachingWrapperFilter( new QueryWrapperFilter(query) );
...

… then I get 0 hits every time, despite the fact that the search expression children.name:parent=junior works just fine in Luke.

Is there something I am missing here? Obviously the information is there since I can search it in Luke. Is there something special you have to do with Hibernate Search to implement a FullTextFilter against an embedded field like this, rather than a simple field?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:43:52+00:00Added an answer on June 12, 2026 at 8:43 pm

    While putting together a simple unit test with which to submit a bug ticket, I discovered the real issue. The problem is not a matter of simple fields vs. complex fields. The problem was a frustratingly-silly misunderstanding about capitalization.

    Normally when Hibernate Search builds a Lucene index, the standard analyzer converts all the field values to lower-case. When you mostly use the Hibernate Search DSL for queries, you get accustomed to case-insensitivity. However, when you query using the Lucene API directly, you are responsible for making your search terms lower-case to match the index.

    The behavior that I originally saw was due to the case of my search terms. When I filtered on a simple field, I happened to be using an all-lowercase string. When I filtered on a complex field, I happened to be using a string with a capital letter.

    After making sure that the filter parameter is converted to lower-case, the problem was resolved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Hibernate mapping that looks something like this: <class name=MyEntity> <set name=scalarSet
Environment: I have that User entity : @Entity public class User implements Serializable {
I have an app that I'm attempting to integrate hibernate search into. I'm using
Is this possible? In my project I have Hibernate search which need apache lucene
I have indexed my database using Hibernate Search. I use a custom analyzer, both
I'm using Hibernate Search (which uses Lucene) for searching some Data I have indexed
I have a huge read-only RESTFUL application built in Spring MVC and Hibernate-Search that
I have hibernate configured to print out the sql statements that it generates and
I have a hibernate object that gets detached and transferred to a thick java
I have search query that has many optional parameters and then search word field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.