If you can send a project with Compass Search and the problem you specify, I can try to fix it. It's probably even better if you can enter an issue in JIRA and attach the project.
Post by Josep GarcÃaAttached is a test project I generated for this.
It is a Struts2 modular hibernate project, to which I added 3 different entities with the gen command: Tag, Tag2, Tag3.
Once you have it running with compass search, apart from the tests failing, in jetty:run, if you search with asterisk, you'll see that not all instances are found.
I have commented-out compass-search and replaced it with hibernate-search. Unit tests work fine, and runtime search works, with 3 different entities.
I had to fix this quickly as we have a milestone next week. Would be nice to hear from someone else about this, as this is a serious problem.
I can send a patch file as well.
Cheers,
Josep
I consider this to be a bug.
As I am involved in a project for a customer, I replaced Compass search with Hibernate search, and it works ok for the test case in which compass is failing. It has some good points by the way, such as the possibility to have the indexing done in background in a JMS queue.
Cheers,
Josep
Yes they are on the same package.
Seems like only some random instances are indexed. It's not that nothing is found. The problem is that the * (asterisk) search does not find *all* the instances. I've tried this in a newly generated appfuse app.
Is it only me that cannot index three or more different model classes?
Are all your model classes in the same package? It could be related to the CompassConfigurationPostProcessor, which is used to allow multiple package names for indexed classes.
/**
* Compass Post Processor that allows for adding scan mappings for more than
* one root package.
*/
public class CompassConfigurationPostProcessor implements LocalCompassBeanPostProcessor {
Log log = LogFactory.getLog(CompassConfigurationPostProcessor.class);
public void process(CompassConfiguration config) throws ConfigurationException {
// Look at current class's package and add it if it's not the AppFuse default
String classPackage = this.getClass().getPackage().getName();
String rootPackage = classPackage.substring(0, classPackage.indexOf("webapp") - 1);
if (!rootPackage.equals("org.appfuse")) {
log.debug("Adding scan for package: " + rootPackage);
config.addScan(rootPackage);
}
}
}
Post by Josep GarcÃaDid anyone try the index/search with three or more model classes?
It is not working in my case, either on win or linux.
This is a big problem.
Cheers,
Josep
<af-indextest.zip>