-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feature/3367 missing oaipmh records #2191
Changes from 8 commits
7c30929
e157870
2ca1360
52b4fee
0b0e684
25a4b83
70964ca
79b40e5
bbf2d53
35fe9ae
e43ada7
57a6924
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,5 @@ | |
|
||
# Role | ||
ROLE_ASSOCIATE_EDITOR = 'associate_editor' | ||
|
||
SUBJECTS_SCHEMA = "LCC:" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from copy import deepcopy | ||
from portality.models import Journal, Article | ||
from portality import constants | ||
|
||
class OAIPMHRecord(object): | ||
earliest = { | ||
|
@@ -49,7 +50,6 @@ class OAIPMHRecord(object): | |
"size": 25 | ||
} | ||
|
||
set_limit = {"term" : { "index.schema_subject.exact" : "<set name>" }} | ||
range_limit = { "range" : { "last_updated" : {"gte" : "<from date>", "lte" : "<until date>"} } } | ||
created_sort = [{"last_updated" : {"order" : "desc"}}, {"id.exact" : "desc"}] | ||
|
||
|
@@ -71,9 +71,8 @@ def list_records(self, from_date=None, until_date=None, oai_set=None, list_size= | |
if start_after is not None or from_date is not None or until_date is not None or oai_set is not None: | ||
|
||
if oai_set is not None: | ||
s = deepcopy(self.set_limit) | ||
s["term"]["index.schema_subject.exact"] = oai_set | ||
q["query"]["bool"]["must"].append(s) | ||
a = oai_set.replace(constants.SUBJECTS_SCHEMA,"") | ||
q["query"]["bool"]["should"] = {"match":{"index.classification": a}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be on Also, are we sure it should be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'm confident that this should be a Can we please lay it out the way way as it was before, so use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right. The |
||
|
||
if until_date is not None or from_date is not None or start_after is not None: | ||
d = deepcopy(self.range_limit) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable
a
never used. I think is forgot to remove this line.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amdomanska can you confirm if this line should be used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug, that line is required, but the result of it was not used. I have fixed and pushed.