Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/search #26

Open
wants to merge 28 commits into
base: joint_viewing
Choose a base branch
from
Open

Release/search #26

wants to merge 28 commits into from

Conversation

Rusy13
Copy link
Collaborator

@Rusy13 Rusy13 commented Nov 20, 2024

No description provided.

@@ -47,6 +48,19 @@ services:
networks:
- cassette-world

elasticsearch:
image: elasticsearch:8.9.0 # Используйте образ с Docker Hub
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

комменты чата жпт можно и убрать :)

@@ -63,6 +67,22 @@ func New(isTest bool, port *nat.Port) (*App, error) {
addr := fmt.Sprintf("%s:%d", cfg.Databases.Redis.Host, cfg.Databases.Redis.Port)
rdb := redis.NewClient(&redis.Options{Addr: addr})

cfgEl := elasticsearch.Config{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это все должно браться из конфига, а не быть захардкоженым

"query": map[string]interface{}{
"multi_match": map[string]interface{}{
"query": query,
"fields": []string{"title^2", "description"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поля наверн лучше в константу


res, err := r.Elasticsearch.Search(
r.Elasticsearch.Search.WithContext(ctx),
r.Elasticsearch.Search.WithIndex("movies"), // Укажите ваш индекс
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

"query": map[string]interface{}{
"multi_match": map[string]interface{}{
"query": query,
"fields": []string{"title^2", "description"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в константу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants