Searching sometimes yields no results when my sphinx indices are separated into multiple files in one model.
The versions I'm using:
- Rails - 4.1
- Thinking Sphinx - 3.0.6
- Sphinx - 2.0.9
I have five indices on this model:
ThinkingSphinx::Index.define :incident, name: "incident_index_1" ... do
indexes name
end
ThinkingSphinx::Index.define :incident, name: "incident_index_5" ... do
indexes tags.name, as: :tag
indexes custom_fields_values.value, as: :custom
end
Searching separately, the queries return correct results:
Incident.search(conditions: { custom: "dd" })
Incident.search("some string")
However, combining the field-specific query with the generic query sometimes returns nothing:
Incident.search("some string", conditions: { custom: "dd" })
If "some string" is in the tag
field (which is defined in the same index file), it works. If it is in the name
field (which is defined in a different index file), it doesn't work.