mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-30 18:33:30 +00:00 
			
		
		
		
	 f104b930cf
			
		
	
	
		f104b930cf
		
			
		
	
	
	
	
		
			
			Co-authored-by: miendinh <miendinh@users.noreply.github.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: crazywoola <427733928@qq.com>
		
			
				
	
	
		
			26 lines
		
	
	
		
			840 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			840 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from core.rag.datasource.vdb.elasticsearch.elasticsearch_vector import ElasticSearchConfig, ElasticSearchVector
 | |
| from tests.integration_tests.vdb.test_vector_store import (
 | |
|     AbstractVectorTest,
 | |
|     setup_mock_redis,
 | |
| )
 | |
| 
 | |
| 
 | |
| class ElasticSearchVectorTest(AbstractVectorTest):
 | |
|     def __init__(self):
 | |
|         super().__init__()
 | |
|         self.attributes = ['doc_id', 'dataset_id', 'document_id', 'doc_hash']
 | |
|         self.vector = ElasticSearchVector(
 | |
|             index_name=self.collection_name.lower(),
 | |
|             config=ElasticSearchConfig(
 | |
|                 host='http://localhost',
 | |
|                 port='9200',
 | |
|                 username='elastic',
 | |
|                 password='elastic'
 | |
|             ),
 | |
|             attributes=self.attributes
 | |
|         )
 | |
| 
 | |
| 
 | |
| def test_elasticsearch_vector(setup_mock_redis):
 | |
|     ElasticSearchVectorTest().run_all_tests()
 |