Project

General

Profile

« Previous | Next » 

Revision 58092

added filter by sourceType and TargetType to the api

View differences:

ScholixConnector.py
108 108
        if t_pid_type:
109 109
            queries.append(self.create_pidType_query(t_pid_type, 'target'))
110 110
        if target_Type:
111
            if 'literature' == target_Type:
112
                target_Type = 'publication'
111 113
            queries.append(self.create_typology_query(target_Type,'target'))
112 114
        if source_Type:
113
            queries.append(self.create_typology_query(target_Type,'source'))
115
            if 'literature' == source_Type:
116
                source_Type = 'publication'
117
            queries.append(self.create_typology_query(source_Type,'source'))
114 118

  
119
        
115 120
        q = None
116 121
        for item in queries:
117 122
            if not q:
118 123
                q = item
119 124
            else:
120
                q = q & item
125
                q = q & item        
121 126
        log.debug("REQUEST CREATED {}".format(q))
122 127
        search_object = Search(using=self.connection, index=self.index_name).doc_type('scholix').query(q)
123 128
        log.debug("Page request size is {}".format(page))

Also available in: Unified diff