index option

1 view
Skip to first unread message

Andrea Franz

unread,
Jul 24, 2008, 9:06:51 AM7/24/08
to Thinking Sphinx
Hi there,I'm switching to thinking_sphinx from acts_as_sphinx.
I already have the sphinx configuration file, and 3 models, with an
index each.
Is it possible to specify the index for each model?
Looking at the code I found this line in search.rb:

results = client.query query

I modified it:

results = client.query query, options[:index] || '*'

Now it works but maybe there is a better option.
Any suggestion? thank you very much!

-andrea

Pat Allan

unread,
Jul 27, 2008, 7:05:22 PM7/27/08
to thinkin...@googlegroups.com
Hi Andrea

What's your reason for needing to search a specific index? Each model
is in their own index (or pair of indexes, if you're using deltas), so
I've assumed searching on a specific model should be enough.

Cheers

--
Pat

Minh Tran

unread,
Aug 25, 2008, 7:37:15 PM8/25/08
to Thinking Sphinx
Hello,

It turns out that I'll need to be able to search on specific indexes
as well. Each customer of my company gets their own instance of our
app. Thinking Sphinx will work great if we have one sphinx daemon per
customer instance, but our operations guy wants to have one
centralized server/daemon.

We will have many indexes of the same table (one per customer) and
will need to be able to search a specific index depending on the
customer. Sphinx has a lot of viable possibilities for distributed
setup; some of these makes it harder to use Thinking Sphinx (but not a
problem for Riddle).

I think that's a fairly good reason for needing a feature like this
and thought I should share. Luckily, I don't think it'll be difficult
to add given your clean code =].

--
Minh

On Jul 27, 4:05 pm, Pat Allan <p...@freelancing-gods.com> wrote:
> Hi Andrea
>
> What's your reason for needing to search aspecificindex? Each model  
> is in their ownindex(or pair of indexes, if you're using deltas), so  
> I've assumed searching on aspecificmodel should be enough.
>
> Cheers
>
> --
> Pat
>
> On 24/07/2008, at 9:06 AM, Andrea Franz wrote:
>
>
>
> > Hi there,I'm switching to thinking_sphinx from acts_as_sphinx.
> > I already have the sphinx configuration file, and 3 models, with an
> >indexeach.
> > Is it possible to specify theindexfor each model?
Reply all
Reply to author
Forward
0 new messages