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.
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.