RIght, I'm using search_for_ids and it works; Thinking Sphinx only fetches
the list of IDs not ActiveRecord objects. But when it loads the list of
matching records from sphinx, the underlying protocol returns an enormous
hash (in my case) for each document like this:
{:doc=>31848312, :weight=>1, :index=>22813,
:attributes=>{\"sphinx_internal_id\"=>41015, \"sphinx_deleted\"=>0,
\"class_crc\"=>1924706381, \"sphinx_internal_class\"=>\"GrantRequest\",
\"fip_title_sort\"=>\"..........\", \"request_id_sort\"=>\".............\",
\"project_summary_sort\"=>\"...............\"
.....
}
I have a lot of attributes associated with each document in the index, so
the result is enormous. I debugged the thinking sphinx code, looking
at search.rb's compose_ids_results and it actually includes the text of
each full text field as well as all the attributes, no idea why. I really
need to figure out how to avoid this as it adds significant overhead and I
don't see a need for returning all this data.
Thanks,
Eric
On Tuesday, October 2, 2012 9:00:21 PM UTC-7, Chris wrote:
>
> There is a search_for_ids method. See this
> page<http://pat.github.com/ts/en/searching.html#ids>
> .
>
> On Tuesday, October 2, 2012 8:27:16 PM UTC-4, Eric wrote:
>>
>> I'm returning a fairly large data set from sphinx for a client with a lot
>> of filter attributes. I'm trying to get just the active record IDs.
>>
>> I'm seeing significant delays and a lot of memory usage. In debugging
>> this I noticed that in search.rb's compose_ids_results, the @results object
>> contains not only the active record IDs but pretty much my entire index
>> with all the filter attributes. This is a lot of data and very slow for
>> sphinx to return to my rails app.
>>
>> I'm wondering if there is a way to tell sphinx not to return everything
>> it knows about each document and just return the sphinx_internal_id?
>>
>> Thanks much,
>> Eric
>>
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/thinking-sphinx/-/6jvcR50Me1UJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.