Skip to content

Commit

Permalink
Merge pull request #1648 from MTG/drop_solr451
Browse files Browse the repository at this point in the history
Drop solr451
  • Loading branch information
alastair authored Jan 12, 2023
2 parents 417f641 + e619d06 commit dd70e73
Show file tree
Hide file tree
Showing 12 changed files with 429 additions and 1,506 deletions.
5 changes: 0 additions & 5 deletions accounts/tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from django.utils.http import int_to_base36

import accounts.models
import utils.search.backends.solr451custom
from accounts.management.commands.process_email_bounces import process_message, decode_idna_email
from accounts.models import EmailPreferenceType, EmailBounce, UserEmailSetting
from accounts.views import handle_uploaded_image
Expand All @@ -44,10 +43,6 @@
from tags.models import TaggedItem
from utils.mail import send_mail
from utils.test_helpers import override_avatars_path_with_temp_directory, create_user_and_sounds
# Below we import SolrResponseInterpreter because we're using them in the
# tests to process data returned from Solr. Ideally we should make this test agnostic of search backend and
# prepare fake search data as it would be afeter being processed by SolrResponseInterpreter.
from utils.search.backends.solr451custom import SolrResponseInterpreter


class ProfileGetUserTags(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: "3.7"
volumes:
pgdata:
m2home:
solrdata:
solr5data:
fswebhome:

Expand Down Expand Up @@ -46,6 +45,7 @@ services:
- db
- rabbitmq
- redis
- search

# Search server
search:
Expand Down
13 changes: 0 additions & 13 deletions docker/search/Dockerfile.search

This file was deleted.

67 changes: 0 additions & 67 deletions docker/search/pom.xml

This file was deleted.

9 changes: 9 additions & 0 deletions forum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from utils.cache import invalidate_template_cache
from utils.search import SearchEngineException, get_search_engine
from utils.search.search_forum import delete_posts_from_search_engine
from utils.text import slugify

web_logger = logging.getLogger('web')

Expand Down Expand Up @@ -79,6 +80,14 @@ def get_absolute_url(self):
return reverse("forums-forum", args=[smart_text(self.name_slug)])


@receiver(pre_save, sender=Forum)
def forum_pre_save_set_slug(sender, instance, **kwargs):
"""If a forum has a name set but not a slug, automatically generate the slug
"""
if not instance.id and not instance.name_slug:
instance.name_slug = slugify(instance.name)


class Thread(models.Model):
forum = models.ForeignKey(Forum)
author = models.ForeignKey(User)
Expand Down
2 changes: 0 additions & 2 deletions freesound/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,6 @@
}

SEARCH_ENGINE_BACKEND_CLASS = 'utils.search.backends.solr555pysolr.Solr555PySolrSearchEngine'
SOLR4_SOUNDS_URL = "http://search:8080/fs2/"
SOLR4_FORUM_URL = "http://search:8080/forum/"
SOLR5_SOUNDS_URL = "http://search:8983/solr/freesound/"
SOLR5_FORUM_URL = "http://search:8983/solr/forum/"

Expand Down
2 changes: 1 addition & 1 deletion freesound/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

SOLR_URL = "http://fakehost:8080/fs2/" # Avoid making accidental queries to "real" search server if running
SOLR_FORUM_URL = "http://fakehost:8080/forum/" # Avoid making accidental requests to "real" search server if running
SEARCH_ENGINE_BACKEND_CLASS = 'utils.search.backends.solr451custom.Solr451CustomSearchEngine' # Test with our own custom search engine functions
SEARCH_ENGINE_BACKEND_CLASS = 'utils.search.backends.solr555pysolr.Solr555PySolrSearchEngine' # Test with our own custom search engine functions
SIMILARITY_ADDRESS = 'fakehost' # Avoid making accidental requests to "real" similarity server if running
TAGRECOMMENDATION_ADDRESS = 'fakehost' # Avoid making accidental requests to "real" tag rec server if running

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ PyJWT==1.4.2
pyparsing==2.4.7
pysolr==3.10.0b1
pysndfile==1.4.4
python-cjson==1.1.0
pytz==2020.1
PyYAML==5.4.1
redis==3.2.0
Expand Down
Loading

0 comments on commit dd70e73

Please sign in to comment.