-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Default index is not used in query with 8.13.15 client #8215
Comments
Hi @krasheninnik, this is a similar case as described in #8184 Currently this is the expected behavior as stated here. However, it seems like this is not what users intuitively expect when setting a |
This may well be true for |
@jonyadamit I agree, that the current behavior might not be optimal and, like stated above, I'm open to improve the default 🙂 I just have not decided how exactly the best default behavior would look like. Even when the user specifies an index mapping for a specific type, let's say The default behavior would be to return all Setting the default index/mapping for It's totally fine for APIs that only accept a single index ( |
I see what you mean. |
That's correct. By default, Elasticsearch will return all matching documents (literally all documents in your As I said, I agree that the current behavior is not ideal either and I'm definitely open to improve it. |
Come to think of it, in my opinion at least, If the user specifies a default index, they expect it to be used even with APIs that optionally accept indices. If the user has multiple indices and plan to use them, they will need to specify them anyhow, using wildcards or aliases.. and if they truly want to search all indices then it is very legitimate to specify |
Elastic.Clients.Elasticsearch version: 8.13.15
Elasticsearch version: 8.13.2
.NET runtime version: .NET 6.0.28 and .NET Framework 4.8.9232.0
Operating system version: Windows 10 Pro
Description of the problem including expected versus actual behavior:
I set the DefaultIndex to "features" while configuring ElasticsearchClientSettings, but the request was sent without using this DefaultIndex.
searchResult.DebugInformation:
Valid Elasticsearch response built from a successful (200) low-level call on POST: /_search?typed_keys=true
.similar to #8151
Steps to reproduce:
Expected behavior
I expect http request with index POST:
features/_search?typed_keys=true
The text was updated successfully, but these errors were encountered: