kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Remove deprecated non-OPTIONS parameter passing from wagtailsearch
							rodzic
							
								
									ac7ad067d2
								
							
						
					
					
						commit
						d59cb9f1f7
					
				| 
						 | 
				
			
			@ -2,7 +2,6 @@ from __future__ import absolute_import, unicode_literals
 | 
			
		|||
 | 
			
		||||
import copy
 | 
			
		||||
import json
 | 
			
		||||
import warnings
 | 
			
		||||
 | 
			
		||||
from django.db import models
 | 
			
		||||
from django.utils.crypto import get_random_string
 | 
			
		||||
| 
						 | 
				
			
			@ -10,7 +9,6 @@ from django.utils.six.moves.urllib.parse import urlparse
 | 
			
		|||
from elasticsearch import Elasticsearch, NotFoundError
 | 
			
		||||
from elasticsearch.helpers import bulk
 | 
			
		||||
 | 
			
		||||
from wagtail.utils.deprecation import RemovedInWagtail110Warning
 | 
			
		||||
from wagtail.utils.utils import deep_update
 | 
			
		||||
from wagtail.wagtailsearch.backends.base import (
 | 
			
		||||
    BaseSearchBackend, BaseSearchQuery, BaseSearchResults)
 | 
			
		||||
| 
						 | 
				
			
			@ -770,13 +768,6 @@ class ElasticsearchSearchBackend(BaseSearchBackend):
 | 
			
		|||
        # Get Elasticsearch interface
 | 
			
		||||
        # Any remaining params are passed into the Elasticsearch constructor
 | 
			
		||||
        options = params.pop('OPTIONS', {})
 | 
			
		||||
        if not options and params:
 | 
			
		||||
            options = params
 | 
			
		||||
 | 
			
		||||
            warnings.warn(
 | 
			
		||||
                "Any extra parameter for the ElasticSearch constructor must be passed through the OPTIONS dictionary.",
 | 
			
		||||
                category=RemovedInWagtail110Warning, stacklevel=2
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        self.es = Elasticsearch(
 | 
			
		||||
            hosts=self.hosts,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue