Revision 55638
Added by Katerina Iatropoulou almost 5 years ago
modules/uoa-search/trunk/src/main/java/eu/dnetlib/data/search/solr/SolrResultSet.java | ||
---|---|---|
7 | 7 |
import eu.dnetlib.data.search.utils.solr.SolrResultSetOptionsUtil; |
8 | 8 |
import eu.dnetlib.data.search.utils.solr.SolrResultsFormatter; |
9 | 9 |
import eu.dnetlib.domain.EPR; |
10 |
import eu.dnetlib.functionality.cql.CqlTranslatorImpl; |
|
10 | 11 |
import gr.uoa.di.driver.enabling.resultset.ResultSet; |
11 | 12 |
import org.apache.commons.lang.StringEscapeUtils; |
12 | 13 |
import org.apache.log4j.Logger; |
... | ... | |
365 | 366 |
} |
366 | 367 |
} |
367 | 368 |
|
368 |
/* public static void main(String[] args) throws IOException, CQLParseException, SolrServerException {
|
|
369 |
public static void main(String[] args) throws IOException, CQLParseException, SolrServerException { |
|
369 | 370 |
CloudSolrServer solrClient = new CloudSolrServer("beta.solr.openaire.eu:9983"); |
370 |
solrClient.setDefaultCollection("DMF-index-openaire");
|
|
371 |
solrClient.setDefaultCollection("TMF-index-openaire");
|
|
371 | 372 |
|
372 | 373 |
NamedList<String> queryOpts = new NamedList<String>(); |
373 | 374 |
|
374 | 375 |
//q=*:*&start=0&rows=10&cursorMark=*&sort=dateofcollection asc |
375 |
queryOpts.add("q", new CqlTranslatorImpl().getTranslatedQuery("objIdentifier = acm_________::0002c24f82c295e925a2bdf7bbf49bfc").asLucene());
|
|
376 |
queryOpts.add("q", new CqlTranslatorImpl().getTranslatedQuery("oaftype=result").asLucene());
|
|
376 | 377 |
queryOpts.add("start", "0"); |
377 |
queryOpts.add("rows", "1");
|
|
378 |
queryOpts.add("fl", "__result"); |
|
378 |
queryOpts.add("rows", "2");
|
|
379 |
//queryOpts.add("fl", "__result");
|
|
379 | 380 |
queryOpts.add("shards.tolerant","true"); |
380 |
queryOpts.add("cursorMark", "*"); |
|
381 |
queryOpts.add("sort", "__indexrecordidentifier asc");
|
|
381 |
// queryOpts.add("cursorMark", "*");
|
|
382 |
queryOpts.add("sort", "resultdateofacceptance desc");
|
|
382 | 383 |
|
383 | 384 |
|
384 | 385 |
//queryOpts.add("q", new CqlTranslatorImpl().getTranslatedQuery("oaftype exact project").asLucene()); |
... | ... | |
388 | 389 |
|
389 | 390 |
System.out.println("results " + resp.getResults().size()); |
390 | 391 |
|
391 |
String cursorMark = "*"; |
|
392 |
|
|
393 |
/*String cursorMark = "*"; |
|
392 | 394 |
String nextCursorMark = ""; |
393 | 395 |
|
394 | 396 |
int curs = 0; |
... | ... | |
463 | 465 |
|
464 | 466 |
System.out.println("max: " + max); |
465 | 467 |
*/ |
466 |
// }
|
|
468 |
} |
|
467 | 469 |
|
468 | 470 |
// @Override |
469 | 471 |
// public EPR getEpr() { |
modules/uoa-search/trunk/src/main/java/eu/dnetlib/data/search/app/SearchServiceImpl.java | ||
---|---|---|
230 | 230 |
|
231 | 231 |
epr = index.getBrowsingStatistics(eprQuery, "all", mdFormat, indexLayout); |
232 | 232 |
|
233 |
if (epr == null) {
|
|
233 |
if (epr == null){ |
|
234 | 234 |
throw new SearchServiceException("Something really strange happened there! Index returned null result set id."); |
235 | 235 |
} |
236 | 236 |
|
modules/uoa-search/trunk/src/main/java/eu/dnetlib/data/search/utils/cql/ParameterQueryEnhancer.java | ||
---|---|---|
329 | 329 |
|
330 | 330 |
addMetadataQueryTerm(null, keywords, queryBuilder); |
331 | 331 |
addMetadataQueryTerm("resulttitle", title, queryBuilder); |
332 |
addMetadataQueryTerm("relperson", author, queryBuilder);
|
|
332 |
addMetadataQueryTerm("resultauthor", author, queryBuilder);
|
|
333 | 333 |
addMetadataQueryTerm("country", country, queryBuilder); |
334 | 334 |
} |
335 | 335 |
|
modules/uoa-search/trunk/src/main/java/eu/dnetlib/data/search/web/api/SearchApiService.java | ||
---|---|---|
543 | 543 |
return getCount(request, fullQuery,format, fieldQueries); |
544 | 544 |
} |
545 | 545 |
|
546 |
/* |
|
546 | 547 |
|
547 |
|
|
548 | 548 |
@GET |
549 | 549 |
@Path("/api/people") |
550 | 550 |
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) |
... | ... | |
632 | 632 |
String fullQuery = builtEntity2EntityRelationQuery(RequestResponseHandler.Entity.DATASET, "relpersonid", personid, fieldQueries); |
633 | 633 |
return getCount(request, fullQuery, format, fieldQueries); |
634 | 634 |
} |
635 |
|
|
635 |
*/ |
|
636 | 636 |
@GET |
637 | 637 |
@Path("/api/reports") |
638 | 638 |
@Produces(MediaType.TEXT_PLAIN) |
... | ... | |
652 | 652 |
} |
653 | 653 |
|
654 | 654 |
long startTime = System.nanoTime(); |
655 |
logger.debug("type " + type); |
|
655 | 656 |
final RequestResponseHandler.Entity entity = extractEntity(type); |
657 |
logger.debug("Entity type " + entity); |
|
656 | 658 |
final Transformer transformer = extractTransformer(format, extractEntity(type)); |
657 | 659 |
final boolean special = isSpecialFormat(format); |
658 | 660 |
String responseType = extractResponseFormat(format); |
659 | 661 |
|
660 | 662 |
final String fullQuery = buildSearchRequest(entity, keywords, fieldQueries); |
663 |
logger.debug("fullquery " + fullQuery); |
|
664 |
logger.debug("fieldQueries " + fieldQueries); |
|
661 | 665 |
|
662 | 666 |
try { |
663 | 667 |
SearchResult sr = searchService.newSearch(fullQuery, Locale.getDefault().toString(), fields, fieldQueries,0, 0, format, transformer,null,false); |
modules/uoa-search/trunk/src/main/resources/csv_publication.xsl | ||
---|---|---|
28 | 28 |
<xsl:text>",</xsl:text> |
29 | 29 |
|
30 | 30 |
<!-- Authors --> |
31 |
<xsl:text>"</xsl:text> |
|
31 | 32 |
<xsl:for-each select="creator"> |
32 | 33 |
<xsl:sort select="@rank"/> |
33 |
<xsl:text>"</xsl:text> |
|
34 | 34 |
<xsl:value-of select="."/> |
35 |
<xsl:text>"</xsl:text> |
|
36 | 35 |
<xsl:if test="not(position()=last())"> |
37 | 36 |
<xsl:text>;</xsl:text> |
38 | 37 |
</xsl:if> |
39 | 38 |
</xsl:for-each> |
39 |
<xsl:text>"</xsl:text> |
|
40 | 40 |
<xsl:text>,</xsl:text> |
41 | 41 |
|
42 | 42 |
<!-- Publication Year --> |
modules/uoa-search/trunk/src/main/resources/csv_publication_special.xsl | ||
---|---|---|
32 | 32 |
<xsl:text>",</xsl:text> |
33 | 33 |
|
34 | 34 |
<!-- Authors --> |
35 |
<xsl:text>"</xsl:text> |
|
35 | 36 |
<xsl:for-each select="../../../creator"> |
36 | 37 |
<xsl:sort select="@rank"/> |
37 |
<xsl:text>"</xsl:text> |
|
38 | 38 |
<xsl:value-of select="."/> |
39 |
<xsl:text>"</xsl:text> |
|
40 | 39 |
<xsl:if test="not(position()=last())"> |
41 | 40 |
<xsl:text>;</xsl:text> |
42 | 41 |
</xsl:if> |
43 | 42 |
</xsl:for-each> |
43 |
<xsl:text>"</xsl:text> |
|
44 | 44 |
<xsl:text>,</xsl:text> |
45 | 45 |
|
46 | 46 |
<!-- Publication Year --> |
Also available in: Unified diff
Resolving #4194 and #4031 - csv issues and author field