retire icon indicating copy to clipboard operation
retire copied to clipboard

When manually defining index_name, index_prefix doesn't take effect

Open mikebaldry opened this issue 10 years ago • 3 comments

I have a model called Product, and the index is products_current, in test I want to use test_products_current.

This is not possible currently because if you don't define the name, the prefix is used with the default name.

A prefix should apply either way right?

mikebaldry avatar Sep 12 '13 15:09 mikebaldry

Hmm, that is correct, but I think the current behaviour might actually be less surprising? When you define an index name, you clearly want the index named like this.

I mean, we can take index_prefix into account in https://github.com/karmi/tire/blob/master/lib/tire/model/naming.rb#L34… Would like to hear some opinions on that.

/cc @vhyza

karmi avatar Sep 13 '13 09:09 karmi

Maybe, I guess it depends on who you talk to.. I'd expect a prefix to be applied to everything, especially seen as its primarily used for separating environments.. regardless of wether you define the index_name manually or let it be automatically generated, you'd still want it to be test_ for instance.

Feedback from other users would be good!

On Fri, Sep 13, 2013 at 10:09 AM, Karel Minarik [email protected]:

Hmm, that is correct, but I think the current behaviour might actually be less surprising? When you define an index name, you clearly want the index named like this.

I mean, we can take index_prefix into account in https://github.com/karmi/tire/blob/master/lib/tire/model/naming.rb#L34…Would like to hear some opinions on that.

/cc @vhyza https://github.com/vhyza

— Reply to this email directly or view it on GitHubhttps://github.com/karmi/tire/issues/866#issuecomment-24382159 .

Michael

www.brightbits.co.uk

Company number: 08133555 Registered in England Registered office: 22 Finwell Road, Rainham, Kent, ME8 7PY

mikebaldry avatar Sep 13 '13 09:09 mikebaldry

I tend to skip this, and just leave it to the user to combine everything in the index_name method, and focus on the new client, instead of fixing this, what do you think?

karmi avatar Oct 02 '13 13:10 karmi