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 6991033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:26:19+00:00 2026-05-27T19:26:19+00:00

I’m looking at implementing Sphinx search within our site. Rather than having to do

  • 0

I’m looking at implementing Sphinx search within our site.

Rather than having to do strange things with including new libraries etc, it makes more sense to me to integrate it using SphinxQL, as this is fairly close to native SQL
.
However, I’m concerned that we might end up having to reinvent the wheel so that we can use Sphinx with our system.

To try and prevent this, I want to drag Sphinx into our ORM system.

Has anyone tried this before, or can anyone thing of problems that we might encounter doing this ?

We currently use a mix of Zend Framework with Propel

  • 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-27T19:26:20+00:00Added an answer on May 27, 2026 at 7:26 pm

    Long time Propel user here who recently added Sphinx to our application using Zend Framework.

    Note on Propel and MVC

    What I have noticed during the past few months of development is that I wish I had taken more immediate advantage of the abstraction Propel provides. As you probably know, Propel creates base classes for the ORM as well as empty classes simply extending the base ones.

    Currently a lot of business logic is relying on separate models, when the exact same logic could simply be implemented as methods in the extended Propel classes.

    You should take the same approach to implementing Sphinx search. Try to abstract it using your extended ORM classes.

    Notes on Sphinx

    1. Create views to simplify the indexing: Sphinx does not play well with advanced subqueries and easily gets confused by MySQL functions. Try to abstract the data you want to index so that the total SQL is as simple as SELECT id, field1, field2, field3 FROM MyView. This is particularly useful when you might want to associate each Sphinx document with a user account or some other foreign key relationship that is non-trivial.

    2. Sphinx can only index UINT: Probably a no-brainer in most cases, but you cannot use UUIDs or negative numbers to work around various odd database structures.

    3. Avoid duplicate document ID: Within each Sphinx index, each document ID must be unique. Let us say you want to make objects of type A searchable, but you want to find an object A by searching on tags, comments and geographical positions. The proper way to do this using Sphinx is to make an index A with all meta-data about the object and separate indexes for comments, tags and geographical positions and make sure you put an attribute sql_attr_uint mapping back to object A, then figure out what to retrieve in your code.

    4. Use a recent version of Sphinx: Sphinx is under rapid development and distributions like Debian tend to have a pretty outdated version in the repositories. If possible and you have time to ensure stability, compile from source (Sphinx has few dependencies, so it won’t be a problem in most cases). Also, the PHP library code has a fail safe which prevents the client code from talking to a too recent version of the Sphinx search daemon.

    5. The extent of Sphinx: After you have performed your search, you still need to retrieve the relevant information from the database since Sphinx will only give you the IDs of matching entries. In some situations it might be wise to use something like:

      $a = AQuery::create()
      ->findByPk(ID_FROM_SPHINX)

      in a foreach loop. But in some cases it might be too inefficient to rely on ORM to get the list, especially if you just want to list a few columns for e.g. search results. Then you could instead use a custom optimized SQL select to get the information (possible to do within the Propel classes).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I need to clean up various Word 'smart' characters in user input, including but
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

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.