Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search


Go to End


59 Posts   23885 Views

Avatar
Carbon Crayon

Community Member, 598 Posts

31 July 2010 at 3:32am

Hi Enclave,

So I tried doing as you said, but it seems there is no 'www-data' user on my server (VPS, Centos 5). Instead apache is running as root, so I have made sure all the files are also owned by root, but to no avail....I still get the same error....

Should I try creating the www-data user/group? I am not entirely confident when it comes to root server stuff like this, so any help would be greatly appreciated :)

Thanks

Aram

Avatar
Enclave SSC

Community Member, 31 Posts

31 July 2010 at 9:28pm

Aram apache usually has a root and www instance.

Firstly if you go "cat /etc/passwd" is there no www-data listed?

Avatar
Carbon Crayon

Community Member, 598 Posts

2 August 2010 at 12:35am

nope, as well as the Cpanel site accounts I have:

root, cpanel, mailman and a load of nologin users such as apache, rpc, smmsp, ftp etc.....

And idea why I wouldn't have www?

Thanks for your help

Aram

Avatar
Enclave SSC

Community Member, 31 Posts

2 August 2010 at 4:06am

Edited: 02/08/2010 4:06am

Hi Aram

Something is not correct with your VPS setup. Although your sphinx should still work. Make sure of the following.

Firstly get to a point where you can run Sphinx/reindex in SS - not manually in terminal (set permissions on pid file etc to chmod 777 to do this).

Check what user the searchd process gets loaded as "ps axu".

Set the files in /usr/local/bin relating to Sphinx to the user. Set the files in /tmp/silver...etc to the same user.

You should now get no permission errors and be able to reindex receiving an ok reply.

Avatar
Carbon Crayon

Community Member, 598 Posts

2 August 2010 at 4:12am

Hi Enclave, thanks for the reply.

I can reindex ok now by visiting mysite.com/Sphinx/reindex, it takes about 30s and then I get the message 'OK' in the window.

The error comes when I actually try to search....

Aram

Avatar
Enclave SSC

Community Member, 31 Posts

2 August 2010 at 4:28am

Hi Aram,

Does it not initiate the process under a different user when you try to search, have you checked.

I just copied the SS search code to my controller and changed the references in it to SphinxSearch and got it working that way.

Does your idxs get created now?

Avatar
mark_s

Community Member, 78 Posts

2 August 2010 at 12:49pm

Hi. Sorry, not been able to get to this sooner.

@enclave, I've looked at the code you pastied. I've made a couple of amendments to getDocumentContent. The first is superficial, renaming $document to $case, which is what I think it more reflects. The other is to change ->File() to ->Document(), since Document is the name of relationship in the $has_one (File is the related class, but not the relationship name). The code from the docs probably won't work because the structure you've got is a bit simpler, which is ok, just requires an adjustment.

Can you try that change and see what it does? http://pastebin.com/pAHWNtAN

Mark

Avatar
mark_s

Community Member, 78 Posts

2 August 2010 at 4:22pm

Hi again.

@aram, Strange errors. WARNING: index 'BaseIdx': key 'path' not found' => this one is normal, as the base index is not a real index.
The others I haven't seen before.

Can you try something for me: in sphinx/code/Sphinx.php, after line 459, add this:
<code>echo $indexingOutput</code>

In case you're on a different revision and I've got the line wrong, its in the function reindex, and the echo should be on the line after this code:
<code>
if (!SapphireTest::is_running_test())
$indexingOutput = `{$this->bin('indexer')} --config {$this->VARPath}/sphinx.conf $rotate $idxlist &> /dev/stdout`;
</code>

There is an issue with reindex, as it's error detection is poor and something on my short term list to fix. Putting in the echo will give you the raw output of the indexer, which under some circumstances will show problems, when reindex() would otherwise just return "ok". (it's a laid-back kinda function :-) )

If you could post the results, that would be good.

Mark