pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 469 forks source link

https://manual.manticoresearch.com/Searching/Filters#Range-filters #1224

Closed bkd closed 1 year ago

bkd commented 2 years ago

Range Filters seem to be very useful but looks like TS hasnt implemented this from what I can see. I have a column which is an integer and I need to find values based on a range - the column isnt a sql column but generated column in the Sphinx index

e,g,

indexes 'SELECT people.id * 66 + 2 AS sid, AVG(positions.duration) AS person_position_average_duration FROM people INNER JOIN positions ON positions.person_id = people.id GROUP BY sid ORDER BY sid', as: :person_position_average_duration, source: :query

What is a good work around for this?

pat commented 2 years ago

Hi @bkd - you're right that TS hasn't implemented the HTTP interface for querying Manticore. A workaround might be using a dynamic attribute which uses your range logic to return a specific value, and then filter by that dynamic attribute?

bkd commented 2 years ago

Thanks Pat for the suggestion, I'll see if I can get that working and update in due course ;-)

pat commented 1 year ago

Hi @bkd - I'm going to close this issue as it's been a few months without any change here. That said: if you have further questions or suggestions about this, please do comment again, happy to re-open if required.