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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:33:59+00:00 2026-06-13T16:33:59+00:00

In some instances, Sphinx is returning results without JOIN’d fields I’ve declared as sql_attr_string’s.

  • 0

In some instances, Sphinx is returning results without JOIN’d fields I’ve declared as sql_attr_string’s. Take the following source/index configuration for example:

source myapp_recipe
{
    type                = pgsql
    sql_host            = 
    sql_user            = me
    sql_pass            = secret
    sql_db              = myapp_db
    sql_port            = 

    sql_query           = \
        SELECT myapp_recipe.id as id, \
            myapp_recipe.name as name, \
            myapp_recipe.cookbook_id as cookbook_id, \
            myapp_cookbook.name as cookbook_name, \
            'recipe' as content_type \
        FROM myapp_recipe \
        INNER JOIN myapp_cookbook \
        ON myapp_recipe.cookbook_id = myapp_cookbook.id

    #content_type for django
    sql_attr_string       = content_type

    # stored string fields in the document
    sql_attr_string     = cookbook_name

    # stored and indexed string fields
    sql_field_string     = name

    # ForeignKey's
    sql_attr_uint       = cookbook_id
}

index myapp_recipe
{
    source          = myapp_recipe
    path            = /var/data/myapp_recipe
    docinfo         = extern
    morphology      = none
    stopwords       =
    min_word_len    = 2
    charset_type    = utf-8
    min_prefix_len  = 0
    min_infix_len   = 3
    enable_star     = 0
}

For some searches, result documents are coming back without attributes aside from content_type and name. For a different search, that returns the same document, Sphinx may very well return the same result document WITH all the expected attributes.

Example:
A query for “pizza” will return an incomplete result document (documentA) without JOIN’d string attributes.

A query for “pizza pocket” will return the same document (documentA) WITH all of the expected JOIN’d attributes.

Can anyone explain this baffling behavior?

  • 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-06-13T16:34:00+00:00Added an answer on June 13, 2026 at 4:34 pm

    Check if you don’t have duplicate id’s
    Your sql_query must return a result with unique ids , otherwise Sphinx can have for same id several documents (for Sphinx the id is seen as a simple number , doesn’t apply any uniquity rule ) . When you index, there should be raised an warning that you have duplicates.

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

Sidebar

Related Questions

I have one subclass of NSManagedObject like following and stored some instances by NSManagedObjectContext.
I have the following code: address = #{(article/div.address).inner_html.strip_html.squish} (using Hpricot) And in some instances...
I have seen some instances where people will say you have to use JS
I've this question about pass some instances by ref or not: here is my
I have a MongoDocument X which has some instances of MongoEmbeddedDocument Y. I now
I'm a newbie with SQL... Now I want to display some instances of AddrDistances
I have a datatable with data in it (customer addresses). In some instances, column
I have some Decimal instances in Python. I wish to format them such that
I have been looking into AWS spot instances for some jobs however instead of
With EnumFontFamiliesEx , I get two instances of some fonts, the second of which

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.