Open jord-nijhuis opened 1 year ago
Pinging @elastic/es-search (Team:Search)
I've done some digging in the code, and it appears if I set RestSearchAction.java:408 (the ignoreAliases
-parameter) to false
, my script seems to run:
final IndicesOptions stricterIndicesOptions = IndicesOptions.fromOptions(
indicesOptions.ignoreUnavailable(),
indicesOptions.allowNoIndices(),
false,
false,
false,
true,
- true,
+ false // ignoreAliases
indicesOptions.ignoreThrottled()
);
Output:
Delete previous index 'index0001'
{"acknowledged":true}
Creating index 'index0001'
{"acknowledged":true,"shards_acknowledged":true,"index":"index0001"}
Creating alias 'index'
{"acknowledged":true}
Inserting a document
{"_index":"index0001","_id":"1","_version":2,"result":"updated","forced_refresh":true,"_shards":{"total":2,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1}
Retrieving PIT ID
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 173 100 173 0 0 27876 0 --:--:-- --:--:-- --:--:-- 57666
PIT ID: x-aGBAEJaW5kZXgwMDAxFjNPWEU4dzVNU1lTQ0k2TF9VM1g0SmcAFkJQVW9HSVh0Ul9DVW5qWEVTcFdBeUEAAAAAAAAAABcWa1NVYTN6QnVTSGFfQlp5M0lwbmlZQQABFjNPWEU4dzVNU1lTQ0k2TF9VM1g0SmcAAA==
Searching without PIT ID
{"took":1,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":3.6464314,"hits":[{"_index":"index0001","_id":"1","_score":3.6464314,"_source":
{
"name": "1"
}
}]}}
Searching with PIT ID
{"pit_id":"x-aGBAEJaW5kZXgwMDAxFjNPWEU4dzVNU1lTQ0k2TF9VM1g0SmcAFkJQVW9HSVh0Ul9DVW5qWEVTcFdBeUEAAAAAAAAAABcWa1NVYTN6QnVTSGFfQlp5M0lwbmlZQQABFjNPWEU4dzVNU1lTQ0k2TF9VM1g0SmcAAA==","took":0,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":1,"relation":"eq"},"max_score":null,"hits":[{"_index":"index0001","_id":"1","_score":3.6464314,"_source":
{
"name": "1"
}
,"sort":[3.6464314,1]}]}}
Done!
That being said, I have no idea why the value was true
before, and have no clue what the implications are by setting ignoreAliasses
to false. And of course, it is also possible that there is a good reason why PIT and indices_boost cannot be used together (I am very much a novice when it comes to Elasticsearch), but the documentation did not mention this.
EDIT: I've updated the script to insert a document.
Pinging @elastic/es-search-foundations (Team:Search Foundations)
@javanna is anyone working on this issue? If not, I would like to take this up, thanks!
Can't reproduce on the main branch.
Hey @javanna - can i pick this up?
Elasticsearch Version
8.8.1
Installed Plugins
No response
Java Version
bundled
OS Version
Docker image: elasticsearch:8.8.1, Docker version: 24.0.2, host: MacOS Ventura (M2)
Problem Description
It seems it is not possible to use a PIT-ID in combination with an indices boost on an alias.
In my case, I have two aliases (documents[X] and sections[X]), and two aliases (documents and sections). If I then create a PIT based on these two aliases, and use the PIT in a search query in combination with an index boost for one of the two aliases, I get a 400.
This is a query with a PIT:
And this is the error response:
If I remove the parameters related to the PIT:
Everything works normally.
It may very well be that I am using the API wrongly, but it seems to me that this is a bug (please correct me if I'm wrong)
Steps to Reproduce
indices_boost
for that alias.I've also created a small script that does this:
When I run the script, I get the following output:
Logs (if relevant)
No response