aldryn-search icon indicating copy to clipboard operation
aldryn-search copied to clipboard

Results are incorrect

Open svandeneertwegh opened this issue 3 years ago • 2 comments

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 avatar Mar 03 '21 17:03 svandeneertwegh

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

svandeneertwegh avatar Mar 03 '21 21:03 svandeneertwegh

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...

benzkji avatar Mar 04 '21 13:03 benzkji