Hello Sanjay,

Thank you for your reply. Your suggestion works. Suppose I have 1000
restaurants. Then the following returns the correct facet information:

facets = Restaurant.facets(:limit => 1000, :max_matches => 1000)

By the way, I'm not sure why I need to specify both :limit
and :max_matches.

Now, I have a different problem. The pagination no longer works. If I
do, facets.for, then all the restaurants are loaded at once. How do I
implement pagination?

Anyway, I feel it is unintuitive for pagination settings to interfere
with facet information. If I do a search, and there are 500 results,
the facet information should reflect the total result set (containing
500 records). Currently, the facet information seems to reflect the
result set in the current page.

I would like to find out how others have dealt with the faceted search
issues I'm having.

P.S. If I put a configuration entry in sphinx.conf file for
max_matches and run rake ts:index, then the entry disappears. Running
rake:start and rake:stop doesn't behave that way.

Thank you in advance.

-- Thuva Tharma

On Apr 26, 11:34 am, Sanjay <[email protected]> wrote:
> I think this might be due to the pagination settings on your request.
> To increase the number of results on a specific request, try the
> request with the following parameters:
>
> Restaurant.facets(:limit => 50, :max_matches => 50)
>
> Set your limit based on the number of results you want.  Also note
> that max_matches can not be greater than the value in your sphinx
> configuration file.
>
> On Apr 24, 2:59 pm, Thuva Tharma <[email protected]> wrote:
>
> > I'm having problems with the facets functionality offered by Thinking
> > Sphinx. I have a restaurant model configured as shown in this 
> > pastie:http://gist.github.com/101305
>
> > When I do Restaurant.facets, the returned hash doesn't reflect the
> > records in the database. A sample hash that was returned can be seen
> > in this pastie:http://gist.github.com/101308
>
> > The facet information for region_id is completely correct.
>
> > However, the facet information for cuisine_ids and neighbourhood_id is
> > is wrong. The cuisine_ids and neighbourhood_id hashes are missing many
> > ids that should be there.
>
> > For example, there are 43 restaurants in the neighbourhood given by id
> > 238. Also, there are 407 restaurants with the cuisine given by id 11.
> > As you can see from the pastie above, those ids are not in the hash.
>
> > I couldn't figure out the issue. Reindexing didn't work. I also tried
> > deleting the files in db/sphinx and indexing. That didn't work as
> > well.
>
> > By the way, I'm using 0.9.8-release (r1371).
>
> > Thank you in advance.
>
> > -- Thuva Tharma
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to