Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
thinking sphinx result includes attribute filter data
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eric  
View profile  
 More options Oct 2 2012, 8:27 pm
From: Eric <ehansen...@gmail.com>
Date: Tue, 2 Oct 2012 17:27:15 -0700 (PDT)
Local: Tues, Oct 2 2012 8:27 pm
Subject: thinking sphinx result includes attribute filter data

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris  
View profile  
 More options Oct 3 2012, 12:00 am
From: Chris <ch...@rizyn.com>
Date: Tue, 2 Oct 2012 21:00:21 -0700 (PDT)
Local: Wed, Oct 3 2012 12:00 am
Subject: Re: thinking sphinx result includes attribute filter data

There is a search_for_ids method.  See this page<http://pat.github.com/ts/en/searching.html#ids>
.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric  
View profile  
 More options Oct 3 2012, 8:05 am
From: Eric <ehansen...@gmail.com>
Date: Wed, 3 Oct 2012 05:05:32 -0700 (PDT)
Local: Wed, Oct 3 2012 8:05 am
Subject: Re: thinking sphinx result includes attribute filter data

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric  
View profile  
 More options Oct 3 2012, 8:06 am
From: Eric <ehansen...@gmail.com>
Date: Wed, 3 Oct 2012 05:06:36 -0700 (PDT)
Local: Wed, Oct 3 2012 8:06 am
Subject: Re: thinking sphinx result includes attribute filter data

BTW, I'm using thinking sphinx 2.0.11.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pat Allan  
View profile  
 More options Oct 3 2012, 8:42 am
From: "Pat Allan" <p...@freelancing-gods.com>
Date: Wed, 03 Oct 2012 08:41:39 -0400
Local: Wed, Oct 3 2012 8:41 am
Subject: Re: [ts] thinking sphinx result includes attribute filter data
The :sphinx_select option should do the trick - it's much like a SELECT option for a SQL query... so, try adding this option:

  :sphinx_select => 'sphinx_internal_id'

Not sure off the top of my head whether other attributes will be required, but probably not given you're using search_for_ids.

Cheers

--
Pat

On 03/10/2012, at 10:27 AM, Eric wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eric  
View profile  
 More options Oct 4 2012, 1:13 pm
From: Eric <ehansen...@gmail.com>
Date: Thu, 4 Oct 2012 10:13:31 -0700 (PDT)
Local: Thurs, Oct 4 2012 1:13 pm
Subject: Re: [ts] thinking sphinx result includes attribute filter data

Thanks pat.  As always, you have the answer- sphinx_select does the trick.

I wanted to mention a caveat; although full-text searching and attribute
filtering worked great, I needed to include the fields I wanted to order
by.  So when I build my query, I essentially parse the order clause and add
the fields to the sphinx_select clause and everything works perfectly.

For a large page, this makes an enormous gigantic difference.

Thanks a million!
Eric


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »