Compare commits

...

3 Commits

3 changed files with 26 additions and 4 deletions

View File

@ -11,6 +11,7 @@ import {NewSearchPageComponent, SearchForm} from "./searchUtils/newSearchPage.co
import {properties} from "../../../environments/environment";
import {RefineFieldResultsService} from "../services/refineFieldResults.service";
import {zip} from "rxjs";
import {StringUtils} from "../utils/string-utils.class";
@Component({
@ -251,8 +252,17 @@ export class SearchOrganizationsComponent {
// this.csvParams ="&fq="+this.resourcesQuery;
// }
let openOrgsId = properties.environment != "production" ? "openaire____::0362fcdb3076765d9c0041ad331553e8" : "";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
"reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or " +
"reldatasourcecompatibilityid exact openaire-cris_1.1 or " +
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* " +
"or reldatasourcecompatibilityid = native" +
(openOrgsId ? (" or collectedfromdatasourceid="+StringUtils.quote(openOrgsId)) : "") +
")";
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
this.csvParams += "&fq="+basicQuery;
//var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING;

View File

@ -60,10 +60,14 @@ export class SearchOrganizationsService {
advancedSearchOrganizations (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, minRef: boolean = false):any {
// &type=organizations
let url = properties.searchAPIURLLAst+"resources2/?format=json";
let openOrgsId = properties.environment != "production" ? "openaire____::0362fcdb3076765d9c0041ad331553e8" : "";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
"reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or " +
"reldatasourcecompatibilityid exact openaire-cris_1.1 or " +
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)";
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=* " +
"or reldatasourcecompatibilityid = native" +
(openOrgsId ? (" or collectedfromdatasourceid="+StringUtils.quote(openOrgsId)) : "") +
")";
// url += "&query=";
if(params!= null && params != '' ) {
@ -219,10 +223,15 @@ export class SearchOrganizationsService {
numOfSearchOrganizations2(params: string, properties:EnvProperties, refineParams:string=null ):any {
let url = properties.searchAPIURLLAst+"resources2/?format=json&size=0&type=organizations";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
let openOrgsId = properties.environment != "production" ? "openaire____::0362fcdb3076765d9c0041ad331553e8" : "";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
"reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or " +
"reldatasourcecompatibilityid exact openaire-cris_1.1 or " +
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)";
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*" +
"or reldatasourcecompatibilityid = native" +
(openOrgsId ? (" or collectedfromdatasourceid=" + StringUtils.quote(openOrgsId)) : "") +
")";
// url += "&query=";
if(params!= null && params != '' ) {

View File

@ -7,6 +7,7 @@ import {throwError} from 'rxjs';
import{EnvProperties} from '../properties/env-properties';
import {catchError, map} from "rxjs/operators";
import {StringUtils} from "../string-utils.class";
@Injectable()
export class EntitiesSearchService {
public ready:boolean = false;
@ -60,9 +61,11 @@ export class EntitiesSearchService {
//reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*
let openOrgsId = properties.environment != "production" ? "openaire____::0362fcdb3076765d9c0041ad331553e8" : "";
//url += "((oaftype exact organization and deletedbyinference=false )"+
url += "((oaftype exact organization and deletedbyinference=false and"+
"(reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire4.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=* or reldatasourcecompatibilityid = native))"+
"(reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire4.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=* or reldatasourcecompatibilityid = native"+
(openOrgsId ? (" or collectedfromdatasourceid="+StringUtils.quote(openOrgsId)) : "") +"))"+
" and ((organizationlegalname all "+'"'+keyword+'"'+") or (organizationlegalshortname all "+'"'+keyword+'"'+")) " +
// "and " + this.quote(params) + " " +
//"and (collectedfrom exact "+StringUtils.quote(StringUtils.URIEncode(DepositType))+")) "