GreenKiwi
GreenKiwi

Reputation: 1046

Solr synchronous data replication for immediate search availability

I have a solr cloud setup with two servers, each collection has 1 shard and 2 replicas. These two instances sit behind a load balancer that simply works in round robin mode.

In our application, we take the following steps:

  1. Add document to index
  2. Perform queries on that document to find if it matches a series of rules

For this to happen, we need to have that document replicated to the second solr server as soon as it has been committed.

We have solr configured as follows:

solr.autoSoftCommit.maxDocs=1
solr.autoSoftCommit.maxTime=1000

solr.autoCommit.maxDocs=1000
solr.autoCommit.maxTime=15000

As I understand these settings, the solr.autoSoftCommit.maxDocs=1 will cause the the document to be indexed immediately which should cause this index change to be pushed to the replica.

Additionally, the journal will be processed and committed with the autoCommit settings every 1000 documents or every 15s.

What we are seeing is that the document often isn't available on the instance it was added to, and is almost never available on the replica instance.

Upvotes: 2

Views: 566

Answers (1)

Persimmonium
Persimmonium

Reputation: 15791

not directly replying to your main question, but just in case you are not aware of it...in case your queries can be given as Lucene queries, have you looked into using a MemoryIndex containing one doc and running all your queries against it?

I have used this setup and worked wonderfully.

Upvotes: 2

Related Questions