Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CatAliases API #1591

Closed
DivyaMalini opened this issue Oct 12, 2015 · 6 comments
Closed

CatAliases API #1591

DivyaMalini opened this issue Oct 12, 2015 · 6 comments

Comments

@DivyaMalini
Copy link

Hi
I am using CatAliases API to get the list of all aliases .
My request is something like
ICatAliasesRequest catAliasesRequest = new CatAliasesRequest();
return m_elasticClient.CatAliases(catAliasesRequest);

and i am trying to read every record received from response(IEnumerable). I am observing that the records returned only have alias and index information and returns null for Search and Index routing .

Could anyone please confirm if this is a known issue or point me if i am doing something wrong ?

Thanks in advance !!

@robertlyson
Copy link
Contributor

Hi @DivyaMalini,

Did you set routing value during alias creation? Have a look into documentation.

This is how you can do this with the NEST:

  • Object initializer
var putAliasResponse = client.PutAlias(new PutAliasRequest("name")
{
    Routing = "routing"
});
  • Fluent
var putAliasResponse = client.PutAlias(a => a
    .Index(indexName)
    .Name("name")
    .Routing("routing"));

Hope it helps.

@DivyaMalini
Copy link
Author

Hi @robertlyson ,

Yes i had set the routing value during alias creation. Even when i directly run the command through sense plugin (GET _cat/aliases), the results displayed has SearchRouting values set. It is when I used the API in my c# code , i found the results whose routing values are null .

@robertlyson
Copy link
Contributor

@DivyaMalini may you share more information about your alias?

@DivyaMalini
Copy link
Author

@robertlyson ,

My PutAlias call is defined like this

public IPutAliasResponse PutAlias(string indexName, string aliasName)
{
var request = new PutAliasRequest(aliasName)
{
Index = new IndexNameMarker()
{
Name = indexName
},
Routing = Gid.NewGuid()
};
return elasticClient.PutAlias(request);
}

The _cat/Aliases call through sense plugin gives aliasName, indexName, Filter, Search and Index routing.

But when executed via code
public ICatResponse CatAliases(ICatAliasesRequest request)
{
CatAliasesRequest req = new CatAliasesRequest();
client.CatAliases(req);
}

in the catAliasesRecord obtained all the aliases routing(index and search) are returned null

FYI , i use Nest 1.6.0

robertlyson added a commit to robertlyson/elasticsearch-net that referenced this issue Oct 15, 2015
@robertlyson
Copy link
Contributor

@DivyaMalini looks like a bug, so I've created #1593 to address this issue.

robertlyson added a commit to robertlyson/elasticsearch-net that referenced this issue Oct 15, 2015
robertlyson added a commit to robertlyson/elasticsearch-net that referenced this issue Oct 15, 2015
@DivyaMalini
Copy link
Author

@robertlyson , Great !!! Thanks a lot ...

gmarz added a commit that referenced this issue Nov 18, 2015
@gmarz gmarz removed the v1.7.2 label Jan 14, 2016
@gmarz gmarz added this to the 1.7.2 milestone Jan 14, 2016
@gmarz gmarz removed this from the 1.7.2 milestone Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants