Jump to:

11001 Posts in 2733 Topics by 1823 members

All other Modules

SilverStripe Forums » All other Modules » Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search

Discuss all other Modules here.

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

Page: 1 2 3 4 5 6 7 8
Go to End
Author Topic: 11799 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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

  • Enclave SSC
    Avatar
    Community Member
    31 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    Aram apache usually has a root and www instance.

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

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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

  • Enclave SSC
    Avatar
    Community Member
    31 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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.

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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

  • Enclave SSC
    Avatar
    Community Member
    31 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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?

  • mark_s
    Avatar
    Community Member
    78 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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

  • mark_s
    Avatar
    Community Member
    78 Posts

    Re: Sphinx 0.1: $SphinxSearchForm / no enabled local indexes to search Link to this post

    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

    11799 Views
Page: 1 2 3 4 5 6 7 8
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.