Elasticsearch index not updated on new faqs

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
kay.goldinger
Posts: 12
Joined: Mon Oct 29, 2018 11:52 am

Elasticsearch index not updated on new faqs

Post by kay.goldinger »

Hi there

Every now and then a faq-author reports a problem, that new faqs woun't get found by the search engine (elasticsearch). If I then update the index manually the counter of the documents increases and the missing faqs appear in the search results. Shounldn't new faqs be added to the index automatically?

Thanks an best regards
Kay
Thorsten
Posts: 15627
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Elasticsearch index not updated on new faqs

Post by Thorsten »

Hi,

which version of phpMyFAQ do you use?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kay.goldinger
Posts: 12
Joined: Mon Oct 29, 2018 11:52 am

Re: Elasticsearch index not updated on new faqs

Post by kay.goldinger »

Hi Thorsten

Sorry for the late response, i've been on hollyday till yesterday :)
The installed phpMyFaq version is 3.1.8, Elasticsearch is 7.16.1

best regsrds
Kay
Thorsten
Posts: 15627
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Elasticsearch index not updated on new faqs

Post by Thorsten »

HI Kay,

I'll check it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15627
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Elasticsearch index not updated on new faqs

Post by Thorsten »

Hi,

this should fix your issue: https://github.com/thorsten/phpMyFAQ/co ... 860aaabdfe

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kay.goldinger
Posts: 12
Joined: Mon Oct 29, 2018 11:52 am

Re: Elasticsearch index not updated on new faqs

Post by kay.goldinger »

Hi Thorsten

I've implemented your fix but unfortunately to no avail.
as far as i can see your fix only applies if an existing faq is saved (record.save.php) and not if a new one is created (record.add.php).
So, I've launched the debugger on my testsystem and it seems that the problem doesn't lie in the elasticsearch implementation but in the mail notification on new faqs. it seems that the thrown exception (I get a return code 550, even thow all receipients exist in our mail system), prevents the method to continue and update the searchindex.

So my short question for a momentary workaround... Is there a config option to disable the notifications on newly added faqs? Of course I could simply remove the code portion from record.add.php, but I'd like to prevent doing too much code customizations, cause of possible problems during future updates.

thanks and bet regards
Kay
Thorsten
Posts: 15627
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Elasticsearch index not updated on new faqs

Post by Thorsten »

Hi,

in the upcoming v3.2 release you'll be able to disable notifications.

I'll check if we can implement a better handling for exception in this case.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kay.goldinger
Posts: 12
Joined: Mon Oct 29, 2018 11:52 am

Re: Elasticsearch index not updated on new faqs

Post by kay.goldinger »

Hi Thorsten

Great to hear that it'll be configurable in 3.2!
For now I've completely disabled the external mail service and am fine with that.

I have another issue/question regarding ElasticSearch.
If I Create a FAQ containing lets say the Word ElasticSearch, I'll have to enter at least "ElasticSear" to the search Box, ohterwise the Search will not return this particular article (maybe some orthers are found even if the do not contain the exacr search term (e.g "elastic").
Is there a rule of thumb, how many characters of a particular word have to be entered, to get a match?

Firther let me say, that I really appreciate your work on this project and I'm allways amazed how fast you provide suggestions and fixes to solve problems.

thanks and best regards
Kay
Post Reply