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 by title not working #19

Closed
tiborsimko opened this issue Aug 5, 2020 · 5 comments
Closed

search by title not working #19

tiborsimko opened this issue Aug 5, 2020 · 5 comments

Comments

@tiborsimko
Copy link
Member

Use case: look up record by CMS dataset titles:

$ cernopendata-client get-record --title '/BTau/Run2010B-Apr21ReReco-v1/AOD'

This is not working in a similar manner as #18, so the fix will be similar.

Note that it could happen that some title would be identical in two records, for example when the record title is not the dataset name, but some free text. We should issue an error when title lookup returns more than one hit.

@tiborsimko
Copy link
Member Author

After #18 was fixed, the error message is:

$ cernopendata-client get-record --title '/BTau/Run2010B-Apr21ReReco-v1/AOD'
More than one record fit this title. This should not happen.

See two records: http://opendata.cern.ch/search?page=1&size=20&q=title:%22%2FBTau%2FRun2010B-Apr21ReReco-v1%2FAOD%22

However, there is precisely one dataset record matching the given title exactly, record ID 1, which should be returned...

@tiborsimko
Copy link
Member Author

(which means that this issue may need to amend search capabilities to offer "exact matching" option)

@tiborsimko
Copy link
Member Author

Just for completeness, here is an example that works:

$ cernopendata-client get-file-locations --title '/DoubleElectron/Run2012B-v1/RAW'

@tiborsimko
Copy link
Member Author

@ParthS007 The last example broke after recent refactoring merge (#32). Can you please look at it?

$ cernopendata-client get-file-locations --title '/DoubleElectron/Run2012B-v1/RAW'
...
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

P.S. It would be good to start introducing test suite to catch these early. I'll create an issue about it.

@tiborsimko
Copy link
Member Author

cernopendata-client get-file-locations --title '/DoubleElectron/Run2012B-v1/RAW'

Fixed as part of PR #42.

The only remaining problem is now returning multiple records. I'll create a separate issue for this.

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