How to stop ThinkingSphinx from querying a database to cut MVA fields?

I have an index set, so I can overlay identifiers on categories, as shown below:

define_index
  ...

  has categorizings.category_id, :type => :multi, :facet => true
end

When I make a type request Listing.facets, I get the correct results in a hash, with each category_id indicating its amount. :)

The only problem is that Thinking Sphinx runs a database query and loads many (but not all) of these objects! Because this attribute is an integer MVA; I do not think they will require a translation.

What's going on here? Is there any way to achieve the best results, can I stop Thinking Sphinx from running all of these ActiveRecord objects? (There could be hundreds!) Or is there a better way to achieve this with Sphinx and Thinking Sphinx?

Thanks!

+3
1
0

Source: https://habr.com/ru/post/1713191/


All Articles