org.ow2.weblab.services.solr.searcher
Class SolrSearcher

java.lang.Object
  extended by org.ow2.weblab.services.solr.searcher.SolrSearcher
All Implemented Interfaces:
org.ow2.weblab.core.services.Searcher

public class SolrSearcher
extends java.lang.Object
implements org.ow2.weblab.core.services.Searcher

Searcher using Embedded Solr server.
RDF output is generated with Jena and can be enriched with metadata stored in index. This should be define in searcher configuration file.


Field Summary
static java.lang.String ASCENDENT_ORDERING_MODE_EXPECTED
           
static java.lang.String BEAN_NAME
           
static java.lang.String TO_BE_ORDERED_BY
           
 
Constructor Summary
SolrSearcher()
           
 
Method Summary
 void destroy()
           
 ResultSetMetadataEnrichment getEnricher()
           
 FacetSuggestion getFacetSuggestion()
           
 Highlighter getHighlighter()
           
 SolrIndexerConfig getIndexerConfig()
           
 java.lang.String getSolrURL()
           
 void init()
           
 boolean isNoCore()
           
protected  org.apache.solr.client.solrj.response.QueryResponse launchSimilarityQuery(org.ow2.weblab.core.model.Query q, int offset, int limit, SolrComponent instance)
           
 org.ow2.weblab.core.services.searcher.SearchReturn search(org.ow2.weblab.core.services.searcher.SearchArgs arg)
           
 org.ow2.weblab.core.model.ResultSet search(java.lang.String context, org.ow2.weblab.core.model.Query q, int offset, int limit)
          Use SolrComponent for Solr index querying and format response in RDF with Jena.
The ResultSet contains a Pok which himself contains Hits.
If enrichment is activated, all fields presents in index and search configuration file are annotated.
 void setEnricher(ResultSetMetadataEnrichment enricher)
           
 void setFacetSuggestion(FacetSuggestion facetSuggestion)
           
 void setHighlighter(Highlighter highlighter)
           
 void setIndexerConfig(SolrIndexerConfig indexerConfig)
           
 void setNoCore(boolean noCore)
           
 void setSolrURL(java.lang.String solrURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_BE_ORDERED_BY

public static final java.lang.String TO_BE_ORDERED_BY
See Also:
Constant Field Values

ASCENDENT_ORDERING_MODE_EXPECTED

public static final java.lang.String ASCENDENT_ORDERING_MODE_EXPECTED
See Also:
Constant Field Values

BEAN_NAME

public static final java.lang.String BEAN_NAME
See Also:
Constant Field Values
Constructor Detail

SolrSearcher

public SolrSearcher()
Method Detail

init

@PostConstruct
public void init()

destroy

@PreDestroy
public void destroy()

search

public org.ow2.weblab.core.services.searcher.SearchReturn search(org.ow2.weblab.core.services.searcher.SearchArgs arg)
                                                          throws org.ow2.weblab.core.services.InvalidParameterException,
                                                                 org.ow2.weblab.core.services.ServiceNotConfiguredException,
                                                                 org.ow2.weblab.core.services.UnexpectedException
Specified by:
search in interface org.ow2.weblab.core.services.Searcher
Throws:
org.ow2.weblab.core.services.InvalidParameterException
org.ow2.weblab.core.services.ServiceNotConfiguredException
org.ow2.weblab.core.services.UnexpectedException

search

public org.ow2.weblab.core.model.ResultSet search(java.lang.String context,
                                                  org.ow2.weblab.core.model.Query q,
                                                  int offset,
                                                  int limit)
                                           throws org.ow2.weblab.core.services.InvalidParameterException,
                                                  org.ow2.weblab.core.services.ServiceNotConfiguredException,
                                                  org.ow2.weblab.core.services.UnexpectedException
Use SolrComponent for Solr index querying and format response in RDF with Jena.
The ResultSet contains a Pok which himself contains Hits.
If enrichment is activated, all fields presents in index and search configuration file are annotated.

Parameters:
q - the Weblab StringQuery
offset - results start index
limit - results end index
Returns:
the ResultSet containing hits
Throws:
org.ow2.weblab.core.services.ServiceNotConfiguredException
org.ow2.weblab.core.services.UnexpectedException
javax.mail.search.SearchException
org.ow2.weblab.core.services.InvalidParameterException

launchSimilarityQuery

protected org.apache.solr.client.solrj.response.QueryResponse launchSimilarityQuery(org.ow2.weblab.core.model.Query q,
                                                                                    int offset,
                                                                                    int limit,
                                                                                    SolrComponent instance)
                                                                             throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException

getIndexerConfig

public SolrIndexerConfig getIndexerConfig()

setIndexerConfig

public void setIndexerConfig(SolrIndexerConfig indexerConfig)

getSolrURL

public java.lang.String getSolrURL()

setSolrURL

public void setSolrURL(java.lang.String solrURL)

getEnricher

public ResultSetMetadataEnrichment getEnricher()

setEnricher

public void setEnricher(ResultSetMetadataEnrichment enricher)

getHighlighter

public Highlighter getHighlighter()

setHighlighter

public void setHighlighter(Highlighter highlighter)

getFacetSuggestion

public FacetSuggestion getFacetSuggestion()

setFacetSuggestion

public void setFacetSuggestion(FacetSuggestion facetSuggestion)

isNoCore

public boolean isNoCore()

setNoCore

public void setNoCore(boolean noCore)


Copyright © 2004-2012. All Rights Reserved.