Thinking sphinx gem version - 4.4.1 Sphinx version - 3.3.1
I get
ERROR: index 'article_core': no full text fields in schema, nothing to index!
while indexing after including where condition in the index definition.
Index definition below
ThinkingSphinx::Index.define :article, :with => :active_record do
indexes title
# where "text = 'Past Simple'" # type of text column is text: rebuild successful
# where "id > 1" # type of id column is int: rebuild successful
where "photo = 'photo'" # type of photo column is String : rebuild fails
end
- The issue occurs when we use where condition inside the index
definition on a string column(char varying) - This issue does not occur when we apply where condition with other data types.
- the error statement is 'ERROR: index 'article_core': no full text fields in schema, nothing to index!.'
I'm wondering if you're using PostgreSQL as your application database? And maybe you don't have any articles which match the
wherecondition? There's an issue with Sphinx 3.x releases where empty indices raise an error when indexing (and it seems it's not fixed in v3.3.1, which only came out last week).I've lodged this issue with the Sphinx team, but there's not been any response thus far.
If you really want to use SQL-backed indices, I'm afraid you're going to have to downgrade to Sphinx 2.2.11, or consider switching to Manticore (a drop-in fork of Sphinx that doesn't have this issue). Or, you could instead use real-time indices, which work fine with Sphinx v3. If so, you can use the
scopemethod within an index to limit the results: