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

(Question) Search Option "seq_no_primary_term" support #2232

Open
ryu818 opened this issue Oct 23, 2024 · 2 comments
Open

(Question) Search Option "seq_no_primary_term" support #2232

ryu818 opened this issue Oct 23, 2024 · 2 comments

Comments

@ryu818
Copy link

ryu818 commented Oct 23, 2024

Hello all.
It seems that “seq_no_primary_term” is not yet supported in Elastica's search Option value, is there any reason not to allow this to be specified?
https://github.com/ruflin/Elastica/blob/8.x/src/Search.php#L406-L421

Official Documentation
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-search-api-request-body

@ryu818
Copy link
Author

ryu818 commented Oct 24, 2024

I would like to add some information. After I implemented the retrieval of if_primary_term and if_seq_no, I found that calling save does not result in a Conflict error:

$Index->save(
    $data,
    [
        'if_primary_term' => (int)$primaryTerm,
        'if_seq_no' => (int)$seqNo,
    ]
);

Upon investigation, I discovered that the options list does not include if_primary_term and if_seq_no:

Target Code

I believe that changing $options = $doc->getOptions($endpoint->getParamWhitelist()); would properly set the available option values. Is my understanding correct?

@ruflin
Copy link
Owner

ruflin commented Oct 29, 2024

Hi @ryu818 , I think the main reason is that it is not supported yet is that nobody got around to add it. As you already digged into the code quite a bit, what do you think about opening a PR with the proposed change? This should make also the discussion if it works (or not) etc. much easier. I would really appreciate the contribution.

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

2 participants