gov.nasa.pds.search.core.post
Class SolrPost

java.lang.Object
  extended by gov.nasa.pds.search.core.post.SolrPost

public class SolrPost
extends Object

Class to manage the index used for the Search Service. Includes method to clear, update, and optimize the stored index. Currently implementations use HTTP Client connections to communicate with server. Potential future refactoring could use SolrJ to interact with client. Decision was made to use this method because SolrJ would make more sense if we were posting data incrementally throughout the indexing process. Since that functionality has been separated into distinct components, this makes more sense.

Author:
jpadams

Field Summary
 String searchServiceUrl
          Search Service base endpoint
 
Constructor Summary
SolrPost(String serviceUrl)
          Solr Post constructor.
 
Method Summary
 void clean()
          Deletes all data from the Search Service.
 void optimize()
          Final step in Search Service index process that optimizes the stored index.
 void post(String dir, List<String> filePrefixList)
          Posts data to Search Service.
 void postIndex(String dir, List<String> filePrefixList)
          Calls the post and optimize methods to complete a post of a list of index files to the Search Service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

searchServiceUrl

public String searchServiceUrl
Search Service base endpoint

Constructor Detail

SolrPost

public SolrPost(String serviceUrl)
         throws SolrPostException
Solr Post constructor. Requires specification of Search Service base endpoint.

Parameters:
serviceUrl -
Throws:
SolrPostException
Method Detail

postIndex

public void postIndex(String dir,
                      List<String> filePrefixList)
               throws SolrPostException
Calls the post and optimize methods to complete a post of a list of index files to the Search Service

Parameters:
dir -
filePrefixList -
Throws:
SolrPostException

clean

public void clean()
           throws SolrPostException
Deletes all data from the Search Service.

Throws:
SolrPostException

post

public void post(String dir,
                 List<String> filePrefixList)
          throws SolrPostException
Posts data to Search Service. Data is taking from the Solr documents found using the directory and filePrefixList.

Parameters:
dir -
filePrefixList -
Throws:
SolrPostException

optimize

public void optimize()
              throws SolrPostException
Final step in Search Service index process that optimizes the stored index.

Throws:
SolrPostException


Copyright © 2010–2014 Planetary Data System. All rights reserved.