<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Comments for : Faceted Queries on acts_as_solr Associations</title>
    <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations</link>
    <description>Comments about Faceted Queries on acts_as_solr Associations from the blog of Chris Umbel, software developer and database administrator.</description>
    <pubDate>2010-05-20 02:05:15 UTC</pubDate>
    <item>
      <title>Comment by: Chris Umbel on 2010-07-30 15:19:59 UTC</title>
      <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c52ed9f75fd7f6168000017</link>
      <description>Sorry I was unable to get back to you.  Thanks for posting your solution!</description>
      <guid>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c52ed9f75fd7f6168000017</guid>
      <pubDate>2010-07-30T15:19:59+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Mazhout on 2010-07-30 05:59:33 UTC</title>
      <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c526a4575fd7f5b3d000020</link>
      <description>Ok,
So the RIGHT solution is very simple:

in my models where the id is a string I just need to add:

acts_as_solr :fields =&gt; [:category], :primary_key_field =&gt; 'pk_s'
</description>
      <guid>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c526a4575fd7f5b3d000020</guid>
      <pubDate>2010-07-30T05:59:33+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Mazhout on 2010-07-30 01:00:47 UTC</title>
      <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c52243f75fd7f59ed000008</link>
      <description>Hi,

I found the solution:
I changed in acts_as_solr/lib/acts_methods the following line:
:primary_key_field =&gt; "pk_i",

to:
:primary_key_field =&gt; "pk_s",

rake solr:reindex and it's ok now, I guess solr can casts id into string.

Cheers.</description>
      <guid>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c52243f75fd7f59ed000008</guid>
      <pubDate>2010-07-30T01:00:47+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Mazhout on 2010-07-29 14:30:13 UTC</title>
      <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c51907575fd7f547f000007</link>
      <description>Hi,

Here is a more precise log:
Thanks,

(eval):1: syntax error, unexpected tIDENTIFIER, expecting ']'
...94,'docs'=&amp;gt;[{'pk_i'=&amp;gt;[798bc248-9a15-11df-8829-001279deb1c4],...
                              ^
(eval):1: syntax error, unexpected tIDENTIFIER, expecting $end
...ocs'=&amp;gt;[{'pk_i'=&amp;gt;[798bc248-9a15-11df-8829-001279deb1c4],'scor...
</description>
      <guid>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c51907575fd7f547f000007</guid>
      <pubDate>2010-07-29T14:30:13+00:00</pubDate>
    </item>
    <item>
      <title>Comment by: Mazhout on 2010-07-29 13:51:47 UTC</title>
      <link>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c51877375fd7f5381000013</link>
      <description>Thanks for this helpful article, I am using acts_as_solr on associations as well but differently.
It used to work until I changed the primary keys to string as I needed to generate random ids with uuid-tools.
I just got an error because the pk_i key expected is of type int and not a string. I can't change it to string as some of my other models use int ids.
Do you have any suggestions by any chance for this problem?

Below is the stacktrace:

INFO: [] webapp=/solr path=/select params={fl=pk_i,score&amp;wt=ruby&amp;qt=standard&amp;q=(hsbc)+AND+(type_s:CrmCompanyHolding);sh_held_t+desc&amp;rows=200} hits=94 status=0 QTime=137 
Jul 29, 2010 9:35:39 PM org.apache.solr.common.SolrException log
SEVERE: java.lang.NumberFormatException: For input string: "079e9e96-991e-11df-bcc3-001279deb1c4"


Thanks,</description>
      <guid>http://www.chrisumbel.com/article/faceted_queries_acts_as_solr_rails_associations#comment_4c51877375fd7f5381000013</guid>
      <pubDate>2010-07-29T13:51:47+00:00</pubDate>
    </item>
  </channel>
</rss>
