-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Documentation on Mapping and Nested Queries #8272
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
Comments
Hi @alikleitcr7, could you please post the JSON request produced by the client? To print the JSON to the console, you could initialize the client like this: var settings = new ElasticsearchClientSettings(new Uri("<redacted>"))
.Authentication(new BasicAuthentication("elastic", "<redacted>"))
.DisableDirectStreaming()
.EnableDebugMode(cd =>
{
Console.WriteLine(cd.DebugInformation);
});
var client = new ElasticsearchClient(settings); |
Hi @flobernd, Here's the debug information:
Any comment on the documentation for this version? |
Hi @alikleitcr7, the produced JSON response looks correct to me, so I guess this might be a mapping problem. It probably makes sense trying to post in the community forums again (in the server category and not the client one) as I can't really help you with this.
The nested query you posted still works in the latest version of the client. Mapping must be done manually like e.g.: await client.Indices.PutMappingAsync<Person>(m => m.Properties(p => p.Nested(n => n.Data)));
The documentation is very sparse at the moment, but the new client (starting from version 8.13) closely maps to the structure of the REST JSON structure. Most method names can be infered by looking at the REST documentation. If there are any concrete questions, feel free to ask them in the .NET client section of the community forums, or - as a last resort - open an issue here. Always happy to help! |
@flobernd Thank you for the response. By community forumes you mean https://discuss.elastic.co/ ? could not find the section you are referring to, is it a category or tag? I saw one net related question posted under I will check with the mapping, there was an attribute Appreciated! 😄 |
@alikleitcr7 Posting it here should probably be the right thing to do.
Auto mapping is currently not implemented in the new client. It's on the roadmap, but I can't give you an ETA for this sadly. |
Thank you @flobernd for the response,
Which did not affect the auto created dynamic index. Thanks to this StackOverflow Post, What worked for me is deleting and recreating the index with
and after indexing a document it appended the rest of the properties to the map. |
@alikleitcr7 Yes, most of the times, index mappings can't be changed if there are already documents indexed. Closing this issue for now as I think your question has been answered. I as well left you a comment on your other question in the community forums. |
Uh oh!
There was an error while loading. Please reload this page.
Elastic.Clients.Elasticsearch version:
8.9.3 - (downgraded from latest 8.14.6 as the documentation does not comply with it)
Elasticsearch version:
8.14.2
.NET runtime version:
net7.0
Operating system version:
window 11
Description of the problem including expected versus actual behavior:
I wanted to post this as a question in the discussion board but I got "An error occurred: Sorry you cannot post a link to that host".
Therefore I'm writing this here.
I'm using the latest elasticsearch-net client, I could not find documentation or hints related to using nested queries or mapping but the deprecated ones (NEST).
What I tried:
this will throw an error "failed to find nested object under path"
added the
ignore
flag underNested
:Query had no error but no documents.
I understand the
Nested
attribute was there inNEST
but could not find it in the mentioned version.Is it experimental that there is only very simple/little CRUD documentation on the new API or am I missing something?
Any take on this would be appreciated.
The text was updated successfully, but these errors were encountered: