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

Search All Option #26

Open
eddybl opened this issue Apr 10, 2021 · 0 comments
Open

Search All Option #26

eddybl opened this issue Apr 10, 2021 · 0 comments

Comments

@eddybl
Copy link
Contributor

eddybl commented Apr 10, 2021

The ELog server allows in the search interface to search across all logbooks. Technically this works by adding the &all=1 flag to the query. For example:
https://elog.psi.ch/elogs/Linux+Demo/?mode=summary&Author=SR&all=1
In this situation, there is a new first column on the result page listing the logbook name. For the actual links etc it doesn't matter, since every link always includes the relative path to the specific logbook

I am very interested in implementing this feature also for the py_elog module. Right now you can manually add the all=1 to your search query by adding it to the input dictionary:

test = Logbook("https://elog.psi.ch/elogs/Linux+Demo")
ids = test.search({"Author": "SR", "all": 1})

The result is that ids has now all the IDs also from other logbooks, which is not ideal.

One possible implementation would be as an optional parameter:
def search(self, search_term, n_results=20, scope="subtext", all=False):
But the return can obviously not be only a list of ints, so this would probably break to much.

Maybe then add a new method:
def search_all(self, search_term, n_results=20, scope="subtext") ?
Here the return code be:

  1. dict with logbook name as key and list of ids als value
  2. tuple with first value same as search: list of ids and second value a dict similar to 1. but with all IDs NOT in the current logbook

Opinions?

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

1 participant