Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

few bugs i found (html errors / wildcard not working / "p" cut off in pagination)


first of all thanks for this great addon!!
I encountered a few problems;

  • in main search modul if i search a word starting with "p", for example "plotter", then the pagination does not work correctly, the p is cut off on all pages > 1, seems that this is done in "views/search/results.php"

  • search results in main search modul html is not handled correctly; it happens sometimes that broken tags are remaining in results body (e.g. "<br" ... without closing bracket which leads to layout problems..). don't know if this is handled by the plugin or by sphinx, anyway in sphinx config i set "html_strip = 1"

  • wildcards do not work, i tried several configuration options (enable_star = 1/0, min_prefix_len = 3, min_infix_len = 3). Only exact matches are found in main search.

i'm using Sphinx 2.0.8 on Ubuntu 10.04 (installed via deb file). Everything is working great expect this few minor problems. hope someone can help.

index settings:

morphology = none dict = crc min_stemming_len = 1 stopwords = /var/www/plott_forum/plugins/SphinxSearch/assests/stop_words.txt #path to text file if enabled, else empty wordforms = min_word_len = 2 min_prefix_len = 3 min_infix_len = 3 enable_star = 1 ngram_len = 0 html_strip = 1 ondisk_dict = 0 inplace_enable = 0 expand_keywords = 0 rt_mem_limit =


  • found another small bug;

    in file views/search/results.php line 79 has to be;

    <span id="SearchAgain"><?php echo Anchor(T('Search Again :: Adv Search'), $GETString, FALSE, FALSE, TRUE) ?></span>

    note the T() ... it's missing in the orig file

  • peregrineperegrine MVP
    edited July 2013

    try this for the truncating p. in results.php


        str_replace('=p', '=', $this->Pager->ToString('more'));
         str_replace('&pg=p', '&pg=', $this->Pager->ToString('more'));  

    in both places

    report back if it works for the p searches and others.
    keep in @mcu_hq might have better changes. but I figured I would offer this up as a possible fix.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • In actuality I don't think it even needs the string replace command

    you could probably just echo $this->Pager->ToString('more')

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • mcu_hqmcu_hq yippie ki-yay ✭✭✭

    Thanks @peregrine for the support. I'll have to investigate the "p" search word issue.

    The default search mode for the regular sphinx plugin is not recognizing the star syntax. I think you may have to enable extended mode, but I have to investigate since it has been a while.

  • SnilloSnillo New
    edited July 2013

    @peregrine, i removed the str_replace in results.php, works fine here, thx!

    regarding the broken tags i could solve the issue. Problem was that i had "Garden.Format.ReplaceNewlines" set to true (don't know if this is standard). This caused sometimes broken <br> tags in result list. To solve this i replaced Line 244 class.widgets.php with following line;

    $BodyArray[] = Gdn_Format::Text($Row->Body, FALSE); //format text here to the special <span> are in tact later

    FALSE means that new lines are never replaced by <br> tags.

    @mcu_hq, how can i enable "extended mode"?

  • mcu_hqmcu_hq yippie ki-yay ✭✭✭
    edited July 2013

    The solution posted by @peregrine works since the letter 'p' gets filtered out anyways in widgets/class.widgets.php line 389. (int)filter_input(INPUT_GET, 'pg', FILTER_SANITIZE_NUMBER_INT). I was unaware of this until now.

    @Snillo That is a very good find! That function should return plain text, which is safe for viewing. If not, I was going to suggest using HTML purifier for all user input. Interesting how that parameter fixed things...I'm not too sure how.

    To access extended mode, click the "Adv::Search" link on the main results page. There should be a dropdown menu with extended mode in it. Now perform a query with the star after making the associated changes in your config file. The SphinxLite version defaults to using extended version. It is possible to do this in the main one as well after a few lines of code have been changed. I'll have to familiarize myself with the code again.

  • meshugymeshugy Musician/Hacker ✭✭

    I have also had no luck getting wildcards to work. I have enable_star = 1 in my sphinx config file but it still won't search using wild cards. Any ideas on how to fix this?

  • mcu_hqmcu_hq yippie ki-yay ✭✭✭
    edited January 2014

    @meshungy Yes, ok I think I found the problem. The index settings should be listed under index vss_main, index vss_delta and index vss_stats separately. The indexer ignores the current settings in the distributed vanilla index. So what you can do is paste your indexer config statements to those respective indexes. For example, to enable wildcards, place the following under index vss_main (or all indexes if you wish):

        min_word_len = 2
    min_infix_len = 2
       enable_star     = 1

    You will need to do that for each index that you want those settings. After saving the config file, you will need to stop searchd, reindex, and then start searchd again. Please look at the official sphinx docs for more info on the settings. I'll change the sphinx_conf.tpl in the next release.


  • meshugymeshugy Musician/Hacker ✭✭

    @mcu_hq That worked! Thanks so much for getting the wildcards to functioning!!

    Now if I can only get the search by user function working, I'll be in Sphinx heaven...

Sign In or Register to comment.