Closed ushah001 closed 3 years ago
What happens if you disable the debug mode?
What language do you use?
en only.
nothing happens. only white screen appears.
Looks like nothing's returned for more than 4 letters.
hm, what happens if you use the "find as you type" feature? Does it work?
And please upgrade to phpMyFAQ 3.0.7
If I disable elastic search from Edit Configuration --> Search then "find as you type" feature works and search works as well. But I need to make it work with Elastic Search.
And in my organization, we needed few custom checkboxes and that's why we are not upgrading to 3.0.7 as we have to code again after the upgrade.
Some errors you got are fixed with 3.0.7. What kind of custom checkboxes do you need? Are they interesting for all users?
custom code changes like - 1) new checkbox added for Peer review as my organization needed peer review and then publishing , same way for legal review 2) change in admin side report - added which user did published the FAQs, if FAQ is still active or no etc.
I will try to update on my local and see.
I have one question. Although I am very much new to elastic search. If I create index using phpmyfaq platform only, do I need to do any other code change/config change to index my data so that It starts searching using elastic search ?
What I am unable to understand is, even after index is created - how data in my knowledge base and elastic search is connected.
Sorry for my very basic questions.
After upgrading to 3.0.7, it is still showing blank page when I search:
You have to run a "full import" on the Elasticsearch page. Otherwise nothing is in the search index.
@ushah001 The two feature mentioned are feature that I could integrate into 3.1 for all users, they sound useful.
@thorsten , thanks for including these features to phpmyfaq.
Further, When I do full import, I get response like below.
Now, when I search, I have below issues:
1) auto-complete only works for more than 4 characters search. [this was not the case with full-text search.]
2) when I search for a word less than 4 characters, even though it is part of FAQ question, it gives below error in debug mode - ON. When debug mode is - OFF , it yields no response (blank page).
ie. I wanted to search for - Review. I types revi and hit search.
Debug - True
Debug - False
When I search for a whole word, ie. Review , it brings the result.
Is this nature of implemented elastic search ?
elastic search is mapped to phpmyfaq correctly, I can see below in kibana after I did full import and searched for more than 4 characters words.
I think you missed one fix for the autocomplete stuff, did you change all JS files during the last updates? The wrong behaviour for the auto-completion was fixed in one of the 3.0.x releases and it was in a JS file. I'll check the PHP error when you turned on the debug mode.
@thorsten , it looks like any word which is not part of the FAQ is giving me the error. not just less than 4 character. I debugged the code and found that issue is with Elasticsearch.php --> search function.
when matching FAQs are not found, it should have returned No FAQs found.
Could you please confirm this.
Well, on my test systems it returns "no FAQs found", I cannot reproduce the error you got. Is it possible to get your database dump?
sure anyway it is my localhost test db only. where should i attach it ? it is .sql file.
You can send it to thorsten AT phpmyfaq DOT de
hey @thorsten , finally I figured out the problem.
when there is no matching result, the output from Elasticsearch.php --> search function --> $result = $this->client->search($searchParams); [line no 101] is as below:
when there is a match, the output is as below:
Now, the line of code: $result['hits']['total'] is never empty when there is no match.
I changed the line to $result['hits']['hits'] and it gives me correct output.
all this happens, when elastic search support is enabled.
Ha, and I know, why I couldn't reproduce it, as I fixed it by accident:
https://github.com/thorsten/phpMyFAQ/blob/main/phpmyfaq/src/phpMyFAQ/Search/Elasticsearch.php#L106
Great. one last question before I close this, it is regarding full import.
Just to clarify, do I need to do full-import every time as questions are updated or added every day on my side. So do I have to do full-import only once for the very first time after index is created in elastic search or regularly I have to do full-import ?
The full import is only needed for the first time or e.g. if you want to clean the Elasticsearch index. If you add or update FAQs and you enabled the Elasticsearch feature, new or updated FAQs will be also added to Elasticsearch.
Describe the bug I have created index in elastic search configuration page. When I search with less than 4 characters, it returns data. For letters more than 4 character, I am getting error.
To Reproduce Steps to reproduce the behavior:
Expected behavior Search should happen without errors.
Screenshots
phpMyFAQ (please complete the following information):
Additional context I am not sure how to know if my search is working through elastic search or full-text.