Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
40d8704e
Commit
40d8704e
authored
Jan 06, 2021
by
LE GAC Renaud
Browse files
Update InvenioStore to remove the obsolete method, search
parent
1da6ccd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
modules/store_tools/inveniostore.py
modules/store_tools/inveniostore.py
+0
-44
No files found.
modules/store_tools/inveniostore.py
View file @
40d8704e
...
...
@@ -191,47 +191,3 @@ class InvenioStore(BaseStore):
return
obj
[
0
]
raise
CdsException
(
MSG_INVALID_RESPONSE
)
def
search
(
self
,
query
,
**
kwargs
):
"""Return a list of *JSON record* matching search criteria.
Note:
The method is implemented for store, shelf pairs
relying on ``inspirehep.net``.
Args:
query (str):
query for the inspirehep store.
Use the syntax of the web interface or elasticsearch one.
Keyword Args:
elasticsearch keywords
Returns:
* list of JSON records
Raises:
CdsException:
* the server return an HTTP error.
* JSON object could not be decoded.
"""
url
=
f
"
{
self
.
_api_search
}{
query
}
"
rep
=
self
.
interrogate
(
url
,
timeout
=
30
,
**
kwargs
)
try
:
obj
=
rep
.
json
()
except
ValueError
:
raise
CdsException
(
MSG_HTTP_DECODE
)
# the response is a dict with 3 keys: 'hits', 'links', 'sort_options'
# the hits section is a dict with 2 keys: hits (list), total (int)
try
:
return
obj
[
"hits"
][
"hits"
]
except
(
KeyError
,
TypeError
):
raise
CdsException
(
MSG_INVALID_RESPONSE
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment