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

Support federated search #389

Open
ellnix opened this issue Jan 15, 2025 · 8 comments · May be fixed by #393
Open

Support federated search #389

ellnix opened this issue Jan 15, 2025 · 8 comments · May be fixed by #393
Labels
enhancement New feature or request

Comments

@ellnix
Copy link
Collaborator

ellnix commented Jan 15, 2025

In our current state, the multi-search path is acting as a sort of federated search, except without proper ranking rules.

We should deprecate the old #each and #to_a on MultiSearchResult and add a separate path for federated search.

@curquiza curquiza added the enhancement New feature or request label Jan 15, 2025
@wesharper
Copy link

Would this rely on this PR or is the library sufficiently divergent?

@ellnix
Copy link
Collaborator Author

ellnix commented Jan 28, 2025

Would this rely on this PR or is the library sufficiently divergent?

@wesharper It does, I pinged the author of the PR. Of course there's nothing preventing me from implementing it on this gem before the PR is done, but I think it would violate the spirit of FOSS collaboration.

@wesharper
Copy link

Of course there's nothing preventing me from implementing it on this gem before the PR is done, but I think it would violate the spirit of FOSS collaboration.

@ellnix totally agree here. Happy to support any way I can, we've been antsy to start using this!

@pozelli
Copy link

pozelli commented Feb 6, 2025

@ellnix The PR has been completed! 🎉 I'm really looking forward to this feature, but I don’t want to rush anyone. Do you have any estimate on when the adjustment for the separate federated search path will be made?

@ellnix
Copy link
Collaborator Author

ellnix commented Feb 6, 2025

@pozelli probably today, I can't say when it will get merged though.

@ellnix ellnix linked a pull request Feb 6, 2025 that will close this issue
4 tasks
@pozelli
Copy link

pozelli commented Feb 7, 2025

@pozelli probably today, I can't say when it will get merged though.

@ellnix Thank you so much. From what I'm seeing, I think this can solve my problem, which is caused by having only one pagination for each model. If I force the non-federated multi-search results to be an array (to_a), there will be cases where the pages won't fit properly. I need a single pagination for different models - that is, the federated search.

@pozelli
Copy link

pozelli commented Feb 8, 2025

@ellnix Hi! Hope you are well. Will FederatedSearchResult support pagination backends?

For example, I added the following methods to the class:

def last_page?
    (@metadata['offset'] + @metadata['limit']) >= @metadata['estimatedTotalHits']
end

def out_of_range?
    @metadata['offset'] >= @metadata['estimatedTotalHits']
end

@ellnix
Copy link
Collaborator Author

ellnix commented Feb 8, 2025

@pozelli

I will look into it right now, the endpoint doesn't support the regular pagination options that search does, but I will look into what I can do to add Kaminari and will_paginate support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants