General question about field routing

Hi all,

Is field routing smart enough to set the routing from a query string if the
routing field is presented?
or I have to explicit adding the routing parameter?

Thank you.

Yuhan

--

On Wed, 2012-10-10 at 13:02 -0700, Yuhan Zhang wrote:

Hi all,

Is field routing smart enough to set the routing from a query string
if the routing field is presented?
or I have to explicit adding the routing parameter?

I think you need to be more explicit in your question :slight_smile:

clint

--

Hi Clinton,

I'd like to use index with routing, but wondering whether the code in
application level need to be updated to include the routing parameter.

I have set up field routing on a field called "account_id", and was able
to search with routing parameters to reach only 1 shard:

http://localhost:9200/videos/_search?routing=123&q=*

The existing code consists various queries with account_id provided.
ex:
http://localhost:9200/videos/_search?q=account_id:123+AND+text:test

So, will elasticsearch smartly reach just 1 shard on this query? or will it
still reach all shards?

Thank you.

Yuhan

On Thu, Oct 11, 2012 at 12:47 AM, Clinton Gormley clint@traveljury.comwrote:

On Wed, 2012-10-10 at 13:02 -0700, Yuhan Zhang wrote:

Hi all,

Is field routing smart enough to set the routing from a query string
if the routing field is presented?
or I have to explicit adding the routing parameter?

I think you need to be more explicit in your question :slight_smile:

clint

--

--

Hi Yuhan

The existing code consists various queries with account_id provided.
ex:
http://localhost:9200/videos/_search?q=account_id:123+AND+text:test

So, will elasticsearch smartly reach just 1 shard on this query? or
will it still reach all shards?

Ah right. Not sure, but I think the answer is probably no. It won't do
that automatically. You'll still need to provide the routing value.

Maybe it could be supported. Perhaps open an issue.

clint

--

Hi thanks Clinton, I opened an issue:

verified from apache bench that provided with routing, it is 3 times
faster. so this feature indeed is missing..

Thank you.

Yuhan

On Fri, Oct 12, 2012 at 2:37 AM, Clinton Gormley clint@traveljury.comwrote:

Hi Yuhan

The existing code consists various queries with account_id provided.
ex:
http://localhost:9200/videos/_search?q=account_id:123+AND+text:test

So, will elasticsearch smartly reach just 1 shard on this query? or
will it still reach all shards?

Ah right. Not sure, but I think the answer is probably no. It won't do
that automatically. You'll still need to provide the routing value.

Maybe it could be supported. Perhaps open an issue.

clint

--

--