Project

General

Profile

« Previous | Next » 

Revision 46361

organization basic query always contain compatibility criteria. + sygma with multiple dois

View differences:

modules/uoa-search/branches/newAPI/src/main/java/eu/dnetlib/data/search/web/utils/RequestResponseHandler.java
21 21
        private final List<String> DATASET_FIELD_QUERIES = Arrays.asList("oaftype exact result", "resulttypeid exact dataset");
22 22
        private final List<String> PROJECT_FIELD_QUERIES = Arrays.asList("oaftype exact project");
23 23
        private final List<String> DATASOURCE_FIELD_QUERIES = Arrays.asList("oaftype exact datasource");
24
        private final List<String> ORGANIZATION_FIELD_QUERIES = Arrays.asList("oaftype exact organization");
24
        private final List<String> ORGANIZATION_FIELD_QUERIES = Arrays.asList("oaftype exact organization",
25
                "reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
26
                "reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or " +
27
                "reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*");
28

  
25 29
        private final List<String> PERSON_FIELD_QUERIES = Arrays.asList("oaftype exact person");
26 30

  
27 31
        private String value;
......
126 130
    public final static String DATASET_PREFIX = "(oaftype exact result) and (resulttypeid exact dataset)";
127 131
    public final static String PROJECT_PREFIX = "(oaftype exact project)";
128 132
    public final static String DATASOURCE_PREFIX = "(oaftype exact datasource)";
129
    public final static String ORGANIZATION_PREFIX = "(oaftype exact organization)";
133
    public final static String ORGANIZATION_PREFIX = "(oaftype exact organization and " +
134
            "(reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or " +
135
            "reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or " +
136
            "reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy " +
137
            "or relproject=*)";
130 138
    public final static String PERSON_PREFIX = "(oaftype exact person)";
131 139

  
132 140

  
modules/uoa-search/branches/newAPI/src/main/java/eu/dnetlib/data/search/web/api/SearchApiService.java
79 79
                                           @QueryParam("format") final String format,
80 80
                                           @QueryParam("fq") final List<String> fieldQueries,
81 81
                                           @Context final HttpServletRequest request)  {
82
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.PUBLICATION, fieldQueries);
82
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.PUBLICATION, query, fieldQueries);
83 83
        return getCount(request, fullQuery, format, fieldQueries);
84 84
    }
85 85

  
......
119 119
                                       @QueryParam("format") final String format,
120 120
                                       @QueryParam("fq") final List<String> fieldQueries,
121 121
                                       @Context final HttpServletRequest request)  {
122
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.DATASET, fieldQueries);
122
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.DATASET, query, fieldQueries);
123 123
        return getCount(request, fullQuery, format, fieldQueries);
124 124
    }
125 125

  
......
159 159
                                       @QueryParam("format") final String format,
160 160
                                       @QueryParam("fq") final List<String> fieldQueries,
161 161
                                       @Context final HttpServletRequest request) {
162
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.PROJECT, fieldQueries);
162
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.PROJECT, query, fieldQueries);
163 163
        return getCount(request, fullQuery, format, fieldQueries);
164 164
    }
165 165

  
......
250 250
                                          @QueryParam("format") final String format,
251 251
                                          @QueryParam("fq") final List<String> fieldQueries,
252 252
                                          @Context final HttpServletRequest request) {
253
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.DATASOURCE, fieldQueries);
253
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.DATASOURCE, query, fieldQueries);
254 254
        return getCount(request, fullQuery, format, fieldQueries);
255 255
    }
256 256

  
......
289 289
                                            @QueryParam("format") final String format,
290 290
                                            @QueryParam("fq") final List<String> fieldQueries,
291 291
                                            @Context final HttpServletRequest request) {
292
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.ORGANIZATION, fieldQueries);
292
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.ORGANIZATION, query, fieldQueries);
293 293
        return getCount(request, fullQuery, format, fieldQueries);
294 294
    }
295 295

  
......
379 379
                                     @QueryParam("format") final String format,
380 380
                                     @QueryParam("fq") final List<String> fieldQueries,
381 381
                                     @Context final HttpServletRequest request) {
382
        String fullQuery = builtQueryByEntity(query, RequestResponseHandler.Entity.PERSON, fieldQueries);
382
        String fullQuery = buildSearchRequest(RequestResponseHandler.Entity.PERSON, query, fieldQueries);
383 383
        return getCount(request, fullQuery, format, fieldQueries);
384 384
    }
385 385

  
......
601 601

  
602 602
    }
603 603

  
604
    @Deprecated
604 605
    private String builtQueryByEntity(String query, RequestResponseHandler.Entity entity, List<String> fieldQueries) {
605 606
        StringBuilder queryBuilder = new StringBuilder();
606 607
        //enhanceQueryWithEntityType(queryBuilder, entity);
modules/uoa-search/branches/newAPI/src/main/resources/sygma.xsl
26 26
    <xsl:template match="result">
27 27
        <publication>
28 28
            <openaireid><xsl:value-of select="field[@name='resultId']/@value"/></openaireid>
29
            <doi>
30
                <xsl:for-each select="field[@name='pid']">
31
                    <xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
29
            <xsl:for-each select="field[@name='pid']">
30
                <xsl:if test="field[@name='classid' and @value='doi']/@value = 'doi'">
31
                    <doi>
32 32
                        <xsl:value-of select="field[@name='value']/@value"/>
33
                    </xsl:if>
34
                </xsl:for-each>
35
            </doi>
33
                    </doi>
34
                </xsl:if>
35
            </xsl:for-each>
36 36
            <description><xsl:value-of select="field[@name='description']/@value"/></description>
37 37
            <publicationtype><xsl:value-of select="field[@name='datasource'][1]/field[@name='typename']/@value"/></publicationtype>
38 38
            <title><xsl:value-of select="field[@name='title']/@value"/></title>
modules/uoa-search/branches/newAPI/src/main/resources/csv_publication_special.xsl
65 65
            <xsl:copy-of select="replace(../../../source, '&lt;/?\w+[^&lt;]*&gt;', '')"/>
66 66
            <xsl:text>",</xsl:text>
67 67

  
68
            
68

  
69 69
            <!-- Funder -->
70 70
            <xsl:value-of select="../funding/funder/@name"/>
71 71
            <xsl:text>(</xsl:text>

Also available in: Unified diff