SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings
Help

Compass Support Forums » Compass » Compass Users

Thread: Disable concurrent indexing

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


Permlink Replies: 1 - Pages: 1 - Last Post: Oct 27, 2010 4:02 PM Last Post By: lhanson
lhanson

Posts: 13
Registered: 3/23/10
Disable concurrent indexing
Posted: Oct 27, 2010 1:50 PM
 
  Click to reply to this thread Reply
I've got some unit tests which rely on the fact that the docIds assigned to the objects being saved will correspond to the order in which I pass them to CompassIndexSession.save(). i.e., 0, 1, 2. However, this does not always seem to be the case (the docIds in the index can be ordered 1, 2, 0, etc.). At least this is what I'm seeing when I perform a search which matches all documents and print their docIds, so if I'm misunderstanding why they're being returned in varying orders please correct me.

I'm assuming this is because the actual indexing is being done concurrently, and so the actual order in which the items are added to the index is nondeterministic. My reason for believing this is supported by the log line stating:
store.DefaultLuceneSearchEngineStore.[] - Support concurrent operations true and concurrent commits true

Is there a configuration value which will disable concurrent operations? For the purposes of my tests I'm using a RAM-based index. Searching the forum gave one setting (compass.executorManager.type) which could be disabled, but this seems specific to Google AppEngine and causes initialization to fail if I disable it in my app.
lhanson

Posts: 13
Registered: 3/23/10
Re: Disable concurrent indexing
Posted: Oct 27, 2010 4:02 PM   in response to: lhanson in response to: lhanson
 
  Click to reply to this thread Reply
I did some code spelunking, and found compass.engine.useConcurrentOperations and compass.engine.useConcurrentCommits. The JavaDoc wasn't clear on what the distinction between "operations" and "commits" was or why one might choose any particular combination of settings between the two, but through trial and error I discovered that setting "compass.engine.useConcurrentOperations" to false enabled single-threaded document storage, which gives me deterministic behavior when testing.
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