Revision 55434
Added by Sandro La Bruzzo about 5 years ago
DLIESConnector.py | ||
---|---|---|
75 | 75 |
|
76 | 76 |
def links(self, provider=None, s_pid=None, t_pid=None, s_publisher=None, t_publisher=None, s_pid_type=None, |
77 | 77 |
t_pid_type=None, target_Type=None, page=0): |
78 |
|
|
78 | 79 |
queries = [] |
79 | 80 |
if provider: |
80 | 81 |
queries.append(self.create_dataSource_query(provider)) |
... | ... | |
99 | 100 |
else: |
100 | 101 |
q = q & item |
101 | 102 |
search_object = Search(using=self.client, index=self.index_name).doc_type('scholix').query(q) |
103 |
print page |
|
104 |
if page > 1000: |
|
105 |
return [] |
|
102 | 106 |
|
103 | 107 |
return search_object[page:page + 100].execute() |
104 | 108 |
|
... | ... | |
117 | 121 |
|
118 | 122 |
if len(filters): |
119 | 123 |
search_object = search_object.filter(Q('bool', must=filters)) |
124 |
if page > 1000: |
|
125 |
return [] |
|
120 | 126 |
return search_object[page:page + 100].execute() |
121 | 127 |
|
122 | 128 |
def realtionToTypology(self, typology, page=0): |
123 | 129 |
search_object = Search(using=self.client, index=self.index_name).doc_type('scholix').query( |
124 | 130 |
self.create_typology_query(typology)) |
131 |
if page > 1000: |
|
132 |
return [] |
|
125 | 133 |
return search_object[page:page + 100].execute() |
126 | 134 |
|
127 | 135 |
|
Also available in: Unified diff
Added UWSGI Implementation and limit the page to 1000