SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Questions regarding compassGps.index() [solved]

This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Pages: 1 - Last Post: Nov 28, 2011 1:03 AM Last Post By: clothworld
tomy

Posts: 4
Registered: 3/21/07
Questions regarding compassGps.index() [solved]
Posted: Mar 21, 2007 11:30 PM
 
  Click to reply to this thread Reply
Hi Shay,

Sorry for my silly questions as I am new to Compass and am trying to implement compass into a web project(spring+hibernate+mysql).

I have googled and searched this forum since last weekend and could not figure out why my compassGps.index() is not working correctly.

I could rebuild the index by extending SingleCompassGps:

applicationContext.xml:
 
<bean id="compassGps" class="com.test.MyCompassGps"
        init-method="start" destroy-method="stop" singleton="true">
        <property name="compass" ref="compass" />
 
public class MyCompassGps extends org.compass.gps.impl.SingleCompassGps{
 
	public void start() {
		super.start();
		this.index();
	}
	
}


And also by Junit from getting the bean directly from the CTX.
Another applicationContext.xml:
 
<bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps"
        init-method="start" destroy-method="stop" singleton="true">
        <property name="compass" ref="compass" />
 
public class MyKeywordDaoTest extends BaseDaoTestCase{
	...
		String[] paths = { "applicationContext.xml" };
		ctx = new ClassPathXmlApplicationContext(paths);
	...
	public void testReIndex() {
		CompassGps s = (CompassGps) ctx.getBean("compassGps");
		s.index();
	}


Ok, but it failed when I try to extend the CompassIndexController...

public class IndexController extends CompassIndexController {
	private static Logger log = Logger.getLogger(IndexController.class);
 
	private IDatabaseDao databaseDao = null;
 
	public void setDatabaseDao(IDatabaseDao databaseDao) {
		this.databaseDao = databaseDao;
	}
 
	@Override
	protected ModelAndView handle(HttpServletRequest arg0,
			HttpServletResponse arg1, Object arg2, BindException arg3)
			throws Exception {
		
		// No matter this...
		super.getCompassGps().index();
		long time = System.currentTimeMillis();
 
		// Or this...
		getCompassGps().index();
 
		time = System.currentTimeMillis() - time;
		CompassIndexResults indexResults = new CompassIndexResults(time);
 
		return new ModelAndView("index.tiles");
	}
 
}
 
	<bean id="indexController" class="com.test.controllers.IndexController">
		<property name="databaseDao"><ref bean="databaseDao"/></property>
 		<property name="compassGps"><ref bean="compassGps"/></property>
 		<property name="indexView"><value>index.tile</value></property>
 		<property name="indexResultsView"><value>index.tile</value></property>
	</bean>


Here is the log4j output but the index is not being rebuild

log4j: 2007-03-22 15:41:31 \[INFO] \[org.compass.core.lucene.engine.optimizer.ScheduledLuceneSearchEngineOptimizer:stop,75] Stopping scheduled optimizer \[class org.compass.core.impl.DefaultCompass$TransactionalSearchEngineOptimizer]
log4j: 2007-03-22 15:41:31 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:stop,75] Stopping scheduled index manager
Hibernate: deleted
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.impl.DefaultCompass:close,190] Closing Compass \[compass]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:stop,75] Stopping scheduled index manager
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.impl.DefaultCompass:close,200] Closed Compass \[compass]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.optimizer.ScheduledLuceneSearchEngineOptimizer:start,61] Starting scheduled optimizer \[class org.compass.core.impl.DefaultCompass$TransactionalSearchEngineOptimizer] with period \[10000ms] daemon \[true]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:start,61] Starting scheduled index manager with period \[60000ms] daemon \[true]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.optimizer.ScheduledLuceneSearchEngineOptimizer:stop,75] Stopping scheduled optimizer \[class org.compass.core.impl.DefaultCompass$TransactionalSearchEngineOptimizer]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:stop,75] Stopping scheduled index manager
Hibernate: deleted
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.impl.DefaultCompass:close,190] Closing Compass \[compass]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:stop,75] Stopping scheduled index manager
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.impl.DefaultCompass:close,200] Closed Compass \[compass]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.optimizer.ScheduledLuceneSearchEngineOptimizer:start,61] Starting scheduled optimizer \[class org.compass.core.impl.DefaultCompass$TransactionalSearchEngineOptimizer] with period \[10000ms] daemon \[true]
log4j: 2007-03-22 15:41:33 \[INFO] \[org.compass.core.lucene.engine.manager.ScheduledLuceneSearchEngineIndexManager:start,61] Starting scheduled index manager with period \[60000ms] daemon \[true]


Thanks
Tomy

Message was edited by:
tomy
tomy

Posts: 4
Registered: 3/21/07
Re: Questions regarding compassGps.index()
Posted: Mar 21, 2007 11:49 PM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
On this page: http://www.opensymphony.com/compass/versions/1.1/html/spring-mvc.html#spring-mvc-index

It mentions that CompassIndexCommand, but i could not figure out how to inject this object into the indexController from spring.

I also tried to inject compassTemplate into my Dao from Spring


public class DatabaseDao extends HibernateDaoSupport implements IDatabaseDao {
	private static Logger log = Logger.getLogger(DatabaseDao.class);
	private CompassTemplate compassTemplate;
 
	...
 
	CompassGps compassGps =  new SingleCompassGps(compassTemplate.getCompass());
	compassGps.start();
	compassGps.index();
	...
 
	\-----------------------
 
	<bean id="compassTemplate"
		class="org.compass.core.CompassTemplate">
		<property name="compass">
			<ref local="compass" />
		</property>
	</bean>
 
	<bean id="dao" class="com.test.dao.hibernate.DatabaseDao">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
		<property name="compassTemplate">
			<ref local="compassTemplate" />
		</property>
	</bean>
 


It does not work either.

Message was edited by:
tomy
tomy

Posts: 4
Registered: 3/21/07
Re: Questions regarding compassGps.index() [solved]
Posted: Mar 22, 2007 8:39 AM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
Hello, it was my mistake because it was not a full path.
<prop key="compass.engine.connection">file:///temp</prop>


It was set to target/test so it works in junit but I cannot find the index dir. when i run my webapp in tomcat.

Thanks.
ying

Posts: 182
Registered: 11/8/11
Re: Questions regarding compassGps.index() [solved]
Posted: Nov 8, 2011 8:10 PM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
I have received a red color canvas tote. It looks just like a huge buying Armani Outlet Medium Nova Check Hobo Bag along with orange manages. It is a fashionable tote although its physical appearance is very simple and has almost no design. I like the actual Burberry Medium Nova Check Hobo Bag generally because the design is practical. Your tote is large enough to support all my items: two cell phones, my ipad tablet, cosmetics, the bottle of chocalates, a drinking water glass and so forth. In spite of it’s actually big dimensions, there are a lot involving pockets inside so that I could put my personal belongings in diffenrent pockets based on their features. Usually, I am going to work with 2 or more bags as well as the red cloth tote is obviously one of them Armani Watches.
clothworld

Posts: 1,130
Registered: 11/16/11
Canada Goose Jacket
Posted: Nov 22, 2011 2:25 AM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
Simply started out taking pictures the movie Canada Goose Jacket while movie director Steven Spielberg around the staff in the Canada Goose Sale crew declared the particular discipline: not necessarily Canada Goose Parka meeting everyone, additional Canada Goose Youth Parka operate deal discretion conditions must Canada Goose Chilliwack Parka be involved. In a small tropical isle in order to take essential displays, Spielberg and even small block off of the studio, and invited Canada Goose Women Jacket all media editors boarded a small fishing boat, whenever cinematography begins, the particular Canada Goose Canada yacht was having increasingly more of Canada Goose Womens Expedition Parka the correspondents in the studio much. In these security are extremely unpleasant, Canada Goose Expedition Parka a lot of editors have started to understand more about alternate options, they will obtained a little cameras, spend some money to hire nearby residents and individuals across the actors within the facilities or Canada Goose Online captured pics of inside capturing, whenever these works are Canada Goose Coats simply, Sri Lanka Pierre Iceberg yet again pressured self-control, all the extra supplies can be given a $ 80 daily Canada Goose Trillium Parka wage, they should do to accomplish his or her responsibilities in the arrangement, the confidentiality procedures.
ying

Posts: 162
Registered: 11/26/11
Re: Questions regarding compassGps.index() [solved]
Posted: Nov 26, 2011 12:36 AM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
fashion", "trend" and" vogue"? In my opinions, innovations is definitely an idea within an incredible number of individuals mind. For any standard Chanel bags, Some one might think about and it is fashionable, however other people will not think about therefore. Consequently, and it is unneeded in order to go after something that everyone is chasing after of, in the event you are not astounded by this. obtaining helping you uncover appreciation is also a fashion function of you. Gucci Shoes A47808 Y06258 94305 totes, are some of these a bit suitcases in mywebbags store. It is associated with Chanel suitcases 2010, along with charcoal patent leather-based as well as garment and in fact is embellished with interlocking dual D entire in front, together with great deal of entire body for that Gucci Handbags, A47808 Y06258?Gucci Shoes?94305 back pack is different container. Someone requirements big luggage all the while other medication is attached to of micro Chanel purses. The reason why might these people understanding mini Chanel ? Somebody provides mini Chanel suitcases are different and are simple have. And others consider that mini Chanel are normal appropriate regarding many situation, a few of these sa inquiring as well as events Gucci Bags.
clothworld

Posts: 1,130
Registered: 11/16/11
Re:Timberland Boots Sale
Posted: Nov 28, 2011 1:03 AM   in response to: tomy in response to: tomy
 
  Click to reply to this thread Reply
Thought that Timberland Boots Sale all matters need Cheap Timberland Boots by oneself primarily, ever not to Timberland UK consider others' Timberland Boots standpoint Special Timberland Boots or the sentiment, arrogant, Mens Timberland Chukka Boots are supercilious. Passes through time lothes not to be able to put on again second time, likes trading the race car frequently. Had been infatuated with the guitar, but by artistic layman's paternal grandmother was ridiculed, no longer Mens Timberland Boat Shoes moves. “later will talk incessantly paternal grandmother not in the words, the majority of properties turned over to me”, by now paternal Mens Timberland Roll-Top Boots grandmother did not know Mens Timberland Custom Boots has brought the emaciated girl from Womens Timberland 6 Inch Boots where, announced that must give the Womens Timberland Boots entire fortune he, this was also insufficient, old woman added that must cut off his all sources of income. In order to recall this absurd condition, but is working with the high graciousness astronomy, discovered All Timberland Boots that oneself likes on this enemy unexpectedly, he New Timberland Boots feels flustered to his Lovers Timberland Boots action. Unexpectedly graciousness star's side had Timberland Beach Sandals the mature perfect man handsome world, but has received Womens Timberland Roll-Top Boots US since the high school Timberland Kids Boots time's good friend to be Mens Timberland Boots also unable to own sentiment to neglect again, finally Women's Timberland Boots Snow finally with graciousness star Mens Timberland 6 Inch Boots in the same place.
Legend
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums