Repository: deepset-ai/haystack

Issue:
Feature request: add HA support for Weaviate
**Is your feature request related to a problem? Please describe.**
Weaviate has just introduced [HA support in v1.17.0](https://github.com/semi-technologies/weaviate/releases/tag/v1.17.0l), which is obviously very important to be able to take advantage of in production systems using Haystack with Weaviate.

This request is to add the HA option (eg `replicationConfig => factor`) to the Haystack-Weaviate integration, to allow the Weaviate document store to be created with replication set to a desired number.

This will allow those running a replicated Weaviate cluster by setting the replication factor >1 to 
(1) scale out reads to multiple Weaviate nodes
(2) ensure that the document store is running in HA (High Availability), so it is available to service queries even when a Weaviate node is down for an upgrade or such

**Describe the solution you'd like**
Adding the `replicationConfig => factor` parameter to the Weaviate document store with the default value of 1 - this will allow users to set the replication factor to whatever they desire.

I will make a PR for this.

**Describe alternatives you've considered**
Not having HA is not really an alternative in production.

**Additional context**
This will bump the minimum required `weaviate-client` module version to `3.10.0` as the `replicationConfig => factor` is only supported in `3.10.0` and above.


Discussion:

Resolving patch:
diff --git a/haystack/document_stores/weaviate.py b/haystack/document_stores/weaviate.py
--- a/haystack/document_stores/weaviate.py
+++ b/haystack/document_stores/weaviate.py
@@ -76,6 +76,7 @@ def __init__(
         progress_bar: bool = True,
         duplicate_documents: str = "overwrite",
         recreate_index: bool = False,
+        replication_factor: int = 1,
     ):
         """
         :param host: Weaviate server connection URL for storing and processing documents and vectors.
@@ -88,7 +89,7 @@ def __init__(
         :param embedding_dim: The embedding vector size. Default: 768.
         :param content_field: Name of field that might contain the answer and will therefore be passed to the Reader Model (e.g. "full_text").
                            If no Reader is used (e.g. in FAQ-Style QA) the plain content of this field will just be returned.
-        :param name_field: Name of field that contains the title of the the doc
+        :param name_field: Name of field that contains the title of the doc
         :param similarity: The similarity function used to compare document vectors. Available options are 'cosine' (default), 'dot_product' and 'l2'.
                            'cosine' is recommended for Sentence Transformers.
         :param index_type: Index type of any vector object defined in weaviate schema. The vector index type is pluggable.
@@ -110,6 +111,8 @@ def __init__(
         :param recreate_index: If set to True, an existing Weaviate index will be deleted and a new one will be
             created using the config you are using for initialization. Be aware that all data in the old index will be
             lost if you choose to recreate the index.
+        :param replication_factor: It sets the Weaviate Class's replication factor in Weaviate at the time of Class creation.
+                                   See: https://weaviate.io/developers/weaviate/current/configuration/replication.html
         """
         super().__init__()
 
@@ -156,6 +159,7 @@ def __init__(
         self.embedding_field = embedding_field
         self.progress_bar = progress_bar
         self.duplicate_documents = duplicate_documents
+        self.replication_factor = replication_factor
 
         self._create_schema_and_index(self.index, recreate_index=recreate_index)
         self.uuid_format_warning_raised = False
@@ -194,6 +198,7 @@ def _create_schema_and_index(self, index: Optional[str] = None, recreate_index:
                             },
                         ],
                         "vectorIndexConfig": {"distance": self.similarity},
+                        "replicationConfig": {"factor": self.replication_factor},
                     }
                 ]
             }


Test patch: