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 » Tue May 09, 2017 3:24 pm

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: 14482
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

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

Post by Thorsten » Thu May 11, 2017 7:13 pm

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 » Wed May 17, 2017 11:34 am

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: 14482
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

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

Post by Thorsten » Tue May 23, 2017 7:05 pm

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 » Mon May 29, 2017 8:28 am

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 » Fri Jun 02, 2017 10:22 am

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: 14482
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

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

Post by Thorsten » Sun Jun 04, 2017 8:22 am

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 » Tue Jun 06, 2017 1:03 pm

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 » Tue Jun 06, 2017 2:07 pm

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: 14482
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

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

Post by Thorsten » Tue Jun 06, 2017 6:01 pm

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 » Thu Jun 29, 2017 4:45 am

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

Who is online

Users browsing this forum: No registered users and 1 guest