org.apache.stanbol.contenthub.web.resources
Class FeaturedSearchResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.contenthub.web.resources.FeaturedSearchResource

public class FeaturedSearchResource
extends org.apache.stanbol.commons.web.base.resource.BaseStanbolResource

This class is the web resource which provides RESTful and HTTP interfaces for FeaturedSearch services.

Author:
anil.sinaci, suat

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
org.apache.stanbol.commons.web.base.resource.BaseStanbolResource.MenuItem
 
Field Summary
 
Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, servletContext, STATIC_RESOURCES_ROOT_URL, SYSTEM_CONSOLE, uriInfo
 
Constructor Summary
FeaturedSearchResource(javax.servlet.ServletContext context, String indexName)
           
 
Method Summary
 javax.ws.rs.core.Response get(String queryTerm, String solrQuery, String jsonCons, String ontologyURI, int offset, int limit, String fromStore, javax.ws.rs.core.HttpHeaders headers)
          HTTP GET method to make a featured search over Contenthub.
 String getChosenFacets()
           
 Object getDocuments()
           
 String getIndexName()
           
 Object getMoreRecentItems()
           
 int getOffset()
           
 Object getOlderItems()
           
 Object getOntologies()
           
 int getPageSize()
           
 Object getQueryTerm()
           
 Object getSearchResults()
           
 javax.ws.rs.core.Response handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
           
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getConsoleBaseUri, getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRequestUri, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeaturedSearchResource

public FeaturedSearchResource(@Context
                              javax.servlet.ServletContext context,
                              String indexName)
                       throws IOException,
                              org.osgi.framework.InvalidSyntaxException
Parameters:
context -
indexName - Name of the LDPath program (name of the Solr core/index) to be used while storing this content item. LDPath programs can be managed through SemanticIndexManagerResource or SemanticIndexManager
Throws:
IOException
org.osgi.framework.InvalidSyntaxException
Method Detail

handleCorsPreflight

public javax.ws.rs.core.Response handleCorsPreflight(@Context
                                                     javax.ws.rs.core.HttpHeaders headers)

get

public final javax.ws.rs.core.Response get(String queryTerm,
                                           String solrQuery,
                                           String jsonCons,
                                           String ontologyURI,
                                           int offset,
                                           int limit,
                                           String fromStore,
                                           @Context
                                           javax.ws.rs.core.HttpHeaders headers)
                                    throws IllegalArgumentException,
                                           org.apache.stanbol.contenthub.servicesapi.search.SearchException,
                                           InstantiationException,
                                           IllegalAccessException,
                                           org.apache.solr.client.solrj.SolrServerException,
                                           IOException
HTTP GET method to make a featured search over Contenthub.

Parameters:
queryTerm - A keyword a statement or a set of keywords which can be regarded as the query term.
solrQuery - Solr query string. This is the string format which is accepted by a Solr server. For example, q="john doe"&fl=score is a valid value for this parameter. If this parameter exists, search is performed based on this solrQuery and any queryTerms are neglected.
jsonCons - Constrainst in JSON format. These constraints are tranformed to corresponding Solr queries to enable faceted search. Each constraint is a facet field and values of the constraints maps to the values of the facet fields in Solr queries.
ontologyURI - URI of the ontology in which related keywords will be searched by RelatedKeywordSearchManager.getRelatedKeywordsFromOntology(String, String)
offset - The offset of the document from which the resultant documents will start as the search result. offset and limit parameters can be used to make a pagination mechanism for search results.
limit - Maximum number of resultant documents to be returned as the search result. offset and limit parameters can be used to make a pagination mechanism for search results.
fromStore - Special parameter for HTML view only.
headers - HTTP headers
Returns:
HTML view or JSON representation of the search results or HTTP BAD REQUEST(400)
Throws:
IllegalArgumentException
org.apache.stanbol.contenthub.servicesapi.search.SearchException
InstantiationException
IllegalAccessException
org.apache.solr.client.solrj.SolrServerException
IOException

getMoreRecentItems

public Object getMoreRecentItems()

getOlderItems

public Object getOlderItems()

getOffset

public int getOffset()

getPageSize

public int getPageSize()

getSearchResults

public Object getSearchResults()

getDocuments

public Object getDocuments()

getOntologies

public Object getOntologies()

getQueryTerm

public Object getQueryTerm()

getChosenFacets

public String getChosenFacets()

getIndexName

public String getIndexName()


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.