How do I get phpMyFAQ to work with elasticsearch?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Hello,

we've had phpMyFAQ installed for quite some time now. We only just recently realized that the built-in search engine doesn't work perfectly. i. e. we noticed that for each picture we upload, it will create a coded base64 string for that picture in the article-page source. It just happens to be that if you search for short items (about 3 characters long) you will surely find a lot of articles that don't have the keyword in it, it just appears to be in the aforementioned base64 string.

Now we wanted to switch to elasticsearch. I added the elastic.co repo to my debian apt and installed the package. After a bit of configuration (changed hostname the logging paths) i tried the search field on the phpMyFAQ page and I got this error:
Image

The documentation doesn't tell me anything why this error occurs, nor how to index the sql database of my site. Still, the elasticsearch server is running as you can see here

Image

I just can't get it to work with phpMyFAQ
Any ideas?
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by Thorsten »

Hi,

do you have a elasticsearch.php configuration file in /config?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Hello Thorsten,

yes I have this file:
BTW: This server is only for internal use, that's why I used a non-routable IP
(I tried 127.0.0.1 already as well with no success)
Image

If I try to activate it on the web page, I only see a blank frame:
Image
Image
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by Thorsten »

Hi,

please enable the debug mode in inc/Bootstrap.php and try to open this configuration page again to see the errors.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Hi Thorsten,

I'm sorry, but I can't seem to get the debug-mode to work.
I changed the DEBUG boolean to true but the config page stays blank :(
Server restart didn't help either...
Image
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Hello, I just got a step further.

I forgot, that my Apache 2 config used htaccess on /var/www (complete webpage).
I disabled the htaccess and changed it to using the login form phpMyFAQ provides.

Now I actually get a response in the System Information frame in the phpMyFAQ config.
Image

Still, when I activate Elasticsearch and open the System Information page again, it goes blank again. Same the Elsaticsearch configuration page.
And I still don't get any debug output :(

Image

Image
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by Thorsten »

Hi,

please update to 2.9.7, the error message should be visible then.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Hi Thorsten,

thanks for the tip with the update.
I upped the version to the latest one by copying all files from the update package to var/www/html and then running the update through
http://*serverpath*/setup/update.php

Now I'm getting the following debug-output on the elasticsearch config-page:
Image

The line 321 in the file mentioned is as follows:
Image

Any idea, what this could mean, or how to fix this?
kaiserchrss
Posts: 6
Joined: Tue May 09, 2017 3:09 pm

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by kaiserchrss »

Okay, forget it. I got the solution now.
I must admit this was a really dumb mistake :(

My work colleague who set up the server cloned the /var/www/html/ (root-directory phpmyfaq) as a backup - and pasted it right in one level above the directory. so it was in /var/www now, instead of /var/www/html. Of course I was expecting this to be the root directory so I only changed the config in the backup directory instead of the live-website directory.

I feel really stupid now. Sorry for taking your time with this. :/
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by Thorsten »

Hi,

no worries, great that it's working now!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
yafeiliu
Posts: 20
Joined: Wed Aug 24, 2016 2:45 am

Re: How do I get phpMyFAQ to work with elasticsearch?

Post by yafeiliu »

Hi kaiserchrss
I met the same search problem like you.
Do you have the sop about how to set the elasticsearch to work with phpMyFAQ.
Thanks a lot.
Post Reply