no enabled local indexes to search

Samuel Mullen's Avatar

Samuel Mullen

13 Apr, 2012 02:34 AM

Everything is working in development but not in production and the logs aren't providing me with much information either. Trying to get this working by tomorrow.

App is "southern-attraction"

morphology: stem_en enable_star: true min_prefix_len: 3 version: '1.10-beta' [

Index on User model:

define_index do

indexes [ first_name, last_name ], :as => :name
indexes gender

# leaving to show a field can be both an index and an attribute
# has "CRC32(gender)", :as => :gender_filter, :type => :integer

has dob

# locations indexing
indexes current_location.region, :as => :current_region
indexes current_location.state,  :as => :current_state
indexes,   :as => :current_city
indexes current_location.postal_code, :as => :current_postal_code
indexes [, current_location.state, current_location.postal_code,], :as => :current_location
indexes hometown_location.region, :as => :hometown_region
indexes hometown_location.state,  :as => :hometown_state
indexes,   :as => :hometown_city
indexes hometown_location.postal_code, :as => :hometown_postal_code
indexes [, hometown_location.state, hometown_location.postal_code,], :as => :hometown_location
has 'RADIANS(locations.latitude)', :as => :latitude, :type => :float
has 'RADIANS(locations.longitude)', :as => :longitude, :type => :float

# schools indexing
indexes,   :as => :school_name
indexes, :as => :school_degree

# traits indexing
has "array_to_string(array_agg(crc32(traits.marital_status)), ',')", :as => :marital_status, :type => :multi
has "array_to_string(array_agg(crc32(traits.hair_color)), ',')", :as => :hair_color, :type => :multi
has "array_to_string(array_agg(crc32(traits.hair_length)), ',')", :as => :hair_length, :type => :multi
has "array_to_string(array_agg(crc32(traits.eye_color)), ',')", :as => :eye_color, :type => :multi
has "array_to_string(array_agg(crc32(traits.body_type)), ',')", :as => :body_type, :type => :multi
has "array_to_string(array_agg(crc32(traits.ethnicity)), ',')", :as => :ethnicity, :type => :multi
has "array_to_string(array_agg(crc32(traits.profession)), ',')", :as => :profession, :type => :multi
has trait.height, :as => :height
has trait.smokes, :as => :smokes
has trait.alcohol, :as => :alcohol
has trait.drugs, :as => :drugs
has trait.children, :as => :children
has trait.income, :as => :income
has trait.intent, :as => :intent

# interests indexing
has "array_to_string(array_agg(crc32(interests.general)), ',')", :as => :general_interest, :type => :multi
has "array_to_string(array_agg(crc32(interests.specific)), ',')", :as => :specific_interest, :type => :multi
has interests.raiting, :as => :interest_rating

group_by "locations.latitude", "locations.longitude"



  1. Support Staff 1 Posted by Pat Allan on 13 Apr, 2012 04:37 AM

    Pat Allan's Avatar

    Hi Samuel

    Currently your indexing is failing, because it's relying on the crc function. Unfortunately with Heroku's shared databases, we can't add new functions to the databases (and crc is not part of PostgreSQL's default setup).

    I would recommend switching to a case statement with different integer values for your string traits.

    Also: whenever an indexing request fails, the logs are sent to the app's owner - which I'm guessing isn't you, otherwise this may have been a little more clear. You should be able to log in to the dashboard to view those logs though, via `heroku add ons:open flying_sphinx`.

    If there's still problems, let me know.



  2. 2 Posted by Samuel Mullen on 13 Apr, 2012 01:53 PM

    Samuel Mullen's Avatar

    Can you point me to some examples, because it sounds like I'll have to change database fields to integers from strings.

  3. 3 Posted by Samuel Mullen on 13 Apr, 2012 01:57 PM

    Samuel Mullen's Avatar

    Nevermind. It looks like the following post shows how to do it:


  4. Support Staff 4 Posted by Pat Allan on 14 Apr, 2012 01:40 AM

    Pat Allan's Avatar

    Yup, that's what I had in mind.

  5. Pat Allan closed this discussion on 14 Apr, 2012 01:40 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac