Discussion:
compass gps index and search
Josep García
2011-10-26 08:30:00 UTC
Permalink
Did 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
Matt Raible
2011-10-26 13:10:16 UTC
Permalink
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ía
Did 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
Josep García
2011-10-26 13:27:17 UTC
Permalink
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?
Post by Matt Raible
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ía
Did 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
Josep García
2011-10-31 09:32:10 UTC
Permalink
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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
Josep García
2011-11-02 10:09:28 UTC
Permalink
Attached 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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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
Matt Raible
2011-11-02 13:01:05 UTC
Permalink
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.

Thanks,

Matt
Post by Josep García
Attached 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ía
Did 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>
Josep García
2011-11-02 17:20:19 UTC
Permalink
Done:
http://issues.appfuse.org/browse/APF-1280
Post by Matt Raible
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.
Thanks,
Matt
Attached 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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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>
Matt Raible
2011-11-09 23:10:31 UTC
Permalink
Thanks! I'm finishing up some deadlines this week and on vacation for the next two weeks, but will try to look at this in December.
Post by Josep García
http://issues.appfuse.org/browse/APF-1280
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.
Thanks,
Matt
Post by Josep García
Attached 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ía
Did 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>
Josep García
2011-11-11 09:24:42 UTC
Permalink
Good. However, I am quite liking the hibernate-search alternative, as it
has very good documentation available. I have improved on my implementation
of the search on AppFuse. Maybe, it could even be an option of the AppFuse
framework?

Cheers,
Josep
Post by Matt Raible
Thanks! I'm finishing up some deadlines this week and on vacation for the
next two weeks, but will try to look at this in December.
http://issues.appfuse.org/browse/APF-1280
Post by Matt Raible
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.
Thanks,
Matt
Attached 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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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>
Matt Raible
2011-11-11 14:02:21 UTC
Permalink
I'd rather have only one search solution than having to support multiple ones. Would hibernate-search work with iBATIS as well?
Good. However, I am quite liking the hibernate-search alternative, as it has very good documentation available. I have improved on my implementation of the search on AppFuse. Maybe, it could even be an option of the AppFuse framework?
Cheers,
Josep
Thanks! I'm finishing up some deadlines this week and on vacation for the next two weeks, but will try to look at this in December.
Post by Josep García
http://issues.appfuse.org/browse/APF-1280
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.
Thanks,
Matt
Post by Josep García
Attached 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ía
Did 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>
Josep García
2011-11-14 09:55:17 UTC
Permalink
In the soon-to-be-released 4.0 version, it should be possible in theory to
have hibernate-search working with iBATIS.how
Post by Matt Raible
I'd rather have only one search solution than having to support multiple
ones. Would hibernate-search work with iBATIS as well?
Good. However, I am quite liking the hibernate-search alternative, as it
has very good documentation available. I have improved on my implementation
of the search on AppFuse. Maybe, it could even be an option of the AppFuse
framework?
Cheers,
Josep
Post by Matt Raible
Thanks! I'm finishing up some deadlines this week and on vacation for the
next two weeks, but will try to look at this in December.
http://issues.appfuse.org/browse/APF-1280
Post by Matt Raible
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.
Thanks,
Matt
Attached 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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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>
mraible
2012-01-27 13:28:03 UTC
Permalink
Hey Josep - do you have Hibernate Search working in your application?

I tried to upgrade AppFuse to Hibernate 4 this morning and it seems like I'm
blocked by Compass.

testUserSearch(org.appfuse.dao.UserDaoTest): Error creating bean with name
'org.appfuse.dao.UserDaoTest': Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private org.compass.gps.CompassGps
org.appfuse.dao.UserDaoTest.compassGps; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'compassGps' defined in class path resource
[applicationContext-dao.xml]: Invocation of init method failed; nested
exception is java.lang.NoClassDefFoundError:
org/hibernate/impl/SessionFactoryImpl

Thanks,

Matt
Post by Josep García
In the soon-to-be-released 4.0 version, it should be possible in theory to
have hibernate-search working with iBATIS.
Post by Matt Raible
I'd rather have only one search solution than having to support multiple
ones. Would hibernate-search work with iBATIS as well?
Good. However, I am quite liking the hibernate-search alternative, as it
has very good documentation available. I have improved on my
implementation
of the search on AppFuse. Maybe, it could even be an option of the AppFuse
framework?
Cheers,
Josep
Post by Matt Raible
Thanks! I'm finishing up some deadlines this week and on vacation for the
next two weeks, but will try to look at this in December.
http://issues.appfuse.org/browse/APF-1280
Post by Matt Raible
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.
Thanks,
Matt
Attached 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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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ía
Did 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>
--
View this message in context: http://appfuse.547863.n4.nabble.com/compass-gps-index-and-search-tp3939802p4333466.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
Josep García
2012-01-27 14:44:45 UTC
Permalink
Yes.
I enclose our commons lib, with some tests as well.
Please dont' publish it as is.

We can do full text search, with added capability of filtering by date. We
can also filter by date for hql queries, and for getAll().

Maybe it is not fully commented :-(


[image: isotipo isigma]
Josep García Corral
Ingeniero de Software
isigma, la referencia en firma electrónica
Tel. +34 93 519 13 75
www.isigma.es


[image: logotipo portasigma]
¡Prueba gratis la firma online! <http://www.portasigma.com/>
Want a signature like mine?
<http://r1.wisestamp.com/r/landing?promo=22&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_22>
Click
here.<http://r1.wisestamp.com/r/landing?promo=22&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_22>
Post by mraible
Hey Josep - do you have Hibernate Search working in your application?
I tried to upgrade AppFuse to Hibernate 4 this morning and it seems like I'm
blocked by Compass.
testUserSearch(org.appfuse.dao.UserDaoTest): Error creating bean with name
'org.appfuse.dao.UserDaoTest': Injection of autowired dependencies failed;
nested exception is
Could not autowire field: private org.compass.gps.CompassGps
org.appfuse.dao.UserDaoTest.compassGps; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'compassGps' defined in class path resource
[applicationContext-dao.xml]: Invocation of init method failed; nested
org/hibernate/impl/SessionFactoryImpl
Thanks,
Matt
Post by Josep García
In the soon-to-be-released 4.0 version, it should be possible in theory
to
Post by Josep García
have hibernate-search working with iBATIS.
Post by Matt Raible
I'd rather have only one search solution than having to support multiple
ones. Would hibernate-search work with iBATIS as well?
Good. However, I am quite liking the hibernate-search alternative, as it
has very good documentation available. I have improved on my implementation
of the search on AppFuse. Maybe, it could even be an option of the AppFuse
framework?
Cheers,
Josep
Post by Matt Raible
Thanks! I'm finishing up some deadlines this week and on vacation for the
next two weeks, but will try to look at this in December.
http://issues.appfuse.org/browse/APF-1280
Post by Matt Raible
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.
Thanks,
Matt
Attached is a test project I generated for this.
It is a Struts2 modular hibernate project, to which I added 3
different
Post by Josep García
Post by Matt Raible
Post by Matt Raible
Post by Matt Raible
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
Post by Josep García
Post by Matt Raible
Post by Matt Raible
Post by Matt Raible
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
Post by Josep García
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
Post by Josep García
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?
Post by Matt Raible
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
Post by Josep García
Post by Matt Raible
Post by Matt Raible
Post by Matt Raible
Post by Josep García
Post by Josep García
Post by Matt Raible
AppFuse default
String classPackage =
this.getClass().getPackage().getName();
Post by Josep García
Post by Matt Raible
Post by Matt Raible
Post by Matt Raible
Post by Josep García
Post by Josep García
Post by Matt Raible
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ía
Did 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>
--
http://appfuse.547863.n4.nabble.com/compass-gps-index-and-search-tp3939802p4333466.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
Loading...