views:

57

answers:

0

I'm working with hibernate search and I think I'm almost done implementing it except for this one issue. The problem is I don't get any results if the fields I pass into the MultiFieldQueryParser include the class name. I get the expected results when the fields just include the field name.

String[] fields = {"bar.title", "foo.description", "foo.title", "pet.title"};
/*boostPerField<String,Float> is created Dynamically, the values are bar.title=2.0, foo.description=1.0, foo.title=2.0, pet.title=3.0
*/
    QueryParser parser = new MultiFieldQueryParser(fields.toArray(new String[fields.size()]),new SimpleAnalyzer(), boostPerField);
luceneQuery = parser.parse(searchPattern);
FullTextQuery query = entityManager.createFullTextQuery(luceneQuery, classes);

will give me no results, but if the fields = {title, description} then it'll work as expected. Is there any way to include the class name in the field? I want to have the ability to assign different boosts per field per class. Is there anyway to achieve this? I used the seam dvdstore example to model this code, so I would think it's possible. Thank you.