Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1061195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:26:30+00:00 2026-05-16T18:26:30+00:00

I have sphinx installed for my search engine, and it works great, but now

  • 0

I have sphinx installed for my search engine, and it works great, but now I’m trying to add a few extra features to the search using setFilter() which should allow me to do WHERE/AND clauses, but whenever I try a search, it returns no results when there should.

This is my working code:

 require_once ( "sphinxapi.php" );
 $cl = new SphinxClient ();
 $cl->SetConnectTimeout ( 5 );
 $cl->SetMatchMode ( SPH_MATCH_BOOLEAN );
 $cl->SetSortMode ( SPH_SORT_EXPR  , "@weight" );
 $cl->SetFieldWeights ( array ( "item_title"=>100, "item_tags"=>99 ) );
 $cl->SetLimits(0, 1000, 1000, 1000);
 $cl->SetRankingMode ( SPH_RANK_PROXIMITY_BM25 );
 $cl->AddQuery( $term, "indexTubelogr" );

Now I want to start searching with QUERY – AND item_site_id = 1. I add:

$cl->SetFilter('item_site_id', 1);

Then i get the following error:

Warning: assert() [function.assert]: Assertion failed in /home/domain.com/sphinxapi.php on line 810

I also tried:

$cl->SetFilter('item_site_id', array(1));

This didn’t give an error, but again, no results.

My sphinx.conf looks like:

source srcDomain
{
        type                                    = mysql
        sql_sock                                = /tmp/mysql.sock
        sql_attr_timestamp                      = item_date
        sql_ranged_throttle                     = 0
        sql_query_info                          = SELECT * FROM items WHERE item_id=$id
        sql_query                               = \
                SELECT item_id, item_date, item_runtime, item_title, item_tags, item_site_id FROM items
}
index indexDomain
{
        source                  = srcDomain
        path                    = /opt/sphinx/var/data/domain
        docinfo                 = extern
        mlock                   = 0
        morphology              = stem_en
        min_word_len            = 2
        charset_type            = sbcs
        ignore_chars            = U+00AD
        phrase_boundary         = ., ?, !, U+2026 # horizontal ellipsis
        html_strip              = 0
        preopen                 = 1
}

Can anyone please tell me what I am doing wrong?

I removed sensitive data from the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:26:30+00:00Added an answer on May 16, 2026 at 6:26 pm

    Ok I found the problem in the end. I forgot to set the attribute for item_site_id in the sphinx.conf file.

    Then with $cl->SetFilter(‘item_site_id’, array(1)); i pulled the results.

    Thanks for all the info!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Sphinx Search installed as my search engine and I'm trying to add
I have been trying to connect sphinx server with nodejs and limestone module. But
Have my sphinx search going like so: $result = $cl->query($_REQUEST['term'], 'myindex'); But I'd like
How is that possible to show sphinx search result via PHP i have installed
I have MySQL and Sphinx installed and working properly on a LNMP server. Now
I m new in sphinx search.i have installed sphinx in windows 7 . My
I have a similar question here: Sphinx search ranking broken? , but thought I'd
I have a website that is using Sphinx search server to search through a
I have Sphinx running and I can search (YAY), but when I get the
I have installed Sphinx in order to document some Python modules and class I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.