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

Results are incorrect #108

Open
svandeneertwegh opened this issue Mar 3, 2021 · 2 comments
Open

Results are incorrect #108

svandeneertwegh opened this issue Mar 3, 2021 · 2 comments

Comments

@svandeneertwegh
Copy link

svandeneertwegh commented Mar 3, 2021

Hello,

I have elasticsearch 2.4 setup active with pip package elasticsearch2.4 within my django-cms project.

Haystack setup is this;

`
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
'URL': 'http://192.168.1.19:9200/',
'INDEX_NAME': 'haystack',
},
'nl': {
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
'URL': 'http://192.168.1.19:9200/',
'INDEX_NAME': 'haystack-nl',
'TIMEOUT': 60 * 5,
'INCLUDE_SPELLING': True,
'BATCH_SIZE': 100,
},
'en': {
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
'URL': 'http://192.168.1.19:9200/',
'INDEX_NAME': 'haystack-en',
'TIMEOUT': 60 * 5,
'INCLUDE_SPELLING': True,
'BATCH_SIZE': 100,
},
'fr': {
'ENGINE': 'haystack.backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
'URL': 'http://192.168.1.19:9200/',
'INDEX_NAME': 'haystack-fr',
'TIMEOUT': 60 * 5,
'INCLUDE_SPELLING': True,
'BATCH_SIZE': 100,
},
}

HAYSTACK_ROUTERS = ['aldryn_search.router.LanguageRouter',]
`

manage.py rebuild_index and update_index works.

But the problem is my results are not showing or are showing for wrong language. Also it finds a blog article for english but it shows the title from nl from the blog article.

Had anyone also problems with the search?
Or is there a place where i can have support?

@svandeneertwegh
Copy link
Author

Or has it something to do with the djangocms-cascade plugins who i believe are saved in jsonfield?

@benzkji
Copy link

benzkji commented Mar 4, 2021

the jsonfield is probably not a problem, plugins are rendered for the index. I have it working, but with woosh. also. one thing after another - blog articles might not be indexed correctly (the api, with inheritance, is a bit tricky and took me some time to learn).

one thing that helped me, is playing with the SearchQuerySet in the django shell: https://django-haystack.readthedocs.io/en/master/searchqueryset_api.html and try to search only in pages, or only in blogs...

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

No branches or pull requests

2 participants