org.gcube.elasticsearch
Class FullTextNode

java.lang.Object
  extended by org.gcube.elasticsearch.FullTextNode

public class FullTextNode
extends Object


Field Summary
static String COLLECTION_ID_ANALYZER
           
static String DEFAULT_ANALYZER
           
static String META_INDEX
           
 
Constructor Summary
FullTextNode()
           
FullTextNode(String clusterName, String indexName, Integer noOfReplicas, Integer noOfShards, String scope, int maxFragmentCnt, int maxFragmentSize)
           
FullTextNode(String clusterName, String indexName, String scope)
           
FullTextNode(String dataDir, String clusterName, String indexName, Integer noOfReplicas, Integer noOfShards, String scope, int maxFragmentCnt, int maxFragmentSize)
           
FullTextNode(String dataDir, String clusterName, String indexName, String scope)
           
 
Method Summary
 void addIndexType(String indexTypeStr)
           
 void addIndexType(String indexTypeStr, org.gcube.indexmanagement.common.FullTextIndexType indexType)
           
 boolean addMetaIndex()
           
 void clearIndex(String indexTypeName)
           
 void close()
          Closes the index
 void commit()
           
 void commitMeta()
          Commits the changes to the index by sending a flush and a refresh request
 void createOrJoinCluster()
           
 boolean delete()
          Deletes the index and the metaIndex
 Boolean deleteCollection(String collID)
          Deletes the documents of the collection with ID collID
 void deleteDocuments(List<String> docIDs)
          Deletes the documents with IDs within the list docIDs
 boolean feedLocator(String resultSetLocation)
           
 boolean feedLocator(String resultSetLocation, HashMap<String,org.gcube.indexmanagement.common.FullTextIndexType> colForField)
          Feeds the index with rowsets that are read from the the given locator
 boolean feedRowset(String rowset)
          Feeds the index with a rowset.
 String getClusterName()
           
 org.elasticsearch.client.Client getIndexClient()
           
 String getIndexName()
           
 int getMaxFragmentCnt()
           
 int getMaxFragmentSize()
           
 Integer getNoOfReplicas()
           
 Integer getNoOfShards()
           
 String getScope()
           
 void invalidateCache()
           
 void joinCluster(Map<String,Integer> knownNodes)
           
 String query(String queryString)
           
 String query(String queryString, int maxHits)
          Executes the query of gRS2 locator of maximum maxHits records (if >0)
 String queryStream(String queryString)
           
 String queryStream(String queryString, int maxHits)
          Important: The returned results are not sorted!
 boolean rebuildMetaIndex(String[] collectionIds, String[] fields)
           
 void refreshIndexTypesOfIndex()
          Refreshes the index types
 String toString()
           
 boolean updateManagerProperties(HashMap<String,org.gcube.indexmanagement.common.FullTextIndexType> colForIdTypes)
           
 boolean updateManagerPropertiesRemoveCollID(String collectionID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

META_INDEX

public static String META_INDEX

DEFAULT_ANALYZER

public static String DEFAULT_ANALYZER

COLLECTION_ID_ANALYZER

public static String COLLECTION_ID_ANALYZER
Constructor Detail

FullTextNode

public FullTextNode()

FullTextNode

public FullTextNode(String clusterName,
                    String indexName,
                    Integer noOfReplicas,
                    Integer noOfShards,
                    String scope,
                    int maxFragmentCnt,
                    int maxFragmentSize)

FullTextNode

public FullTextNode(String clusterName,
                    String indexName,
                    String scope)

FullTextNode

public FullTextNode(String dataDir,
                    String clusterName,
                    String indexName,
                    Integer noOfReplicas,
                    Integer noOfShards,
                    String scope,
                    int maxFragmentCnt,
                    int maxFragmentSize)

FullTextNode

public FullTextNode(String dataDir,
                    String clusterName,
                    String indexName,
                    String scope)
Method Detail

getClusterName

public String getClusterName()

getIndexName

public String getIndexName()

getNoOfReplicas

public Integer getNoOfReplicas()

getNoOfShards

public Integer getNoOfShards()

getScope

public String getScope()

getMaxFragmentCnt

public int getMaxFragmentCnt()

getMaxFragmentSize

public int getMaxFragmentSize()

getIndexClient

public org.elasticsearch.client.Client getIndexClient()

toString

public String toString()
Overrides:
toString in class Object

addIndexType

public void addIndexType(String indexTypeStr)
                  throws Exception
Throws:
Exception

addIndexType

public void addIndexType(String indexTypeStr,
                         org.gcube.indexmanagement.common.FullTextIndexType indexType)
                  throws Exception
Throws:
Exception

createOrJoinCluster

public void createOrJoinCluster()

joinCluster

public void joinCluster(Map<String,Integer> knownNodes)
                 throws IOException
Parameters:
knownNodes - Map of Address -> Port
Throws:
IOException

query

public String query(String queryString)
             throws org.gcube.indexmanagement.common.IndexException,
                    gr.uoa.di.madgik.grs.writer.GRS2WriterException
Parameters:
queryString -
Returns:
gRS2 locator of the query results
Throws:
org.gcube.indexmanagement.common.IndexException
gr.uoa.di.madgik.grs.writer.GRS2WriterException

query

public String query(String queryString,
                    int maxHits)
             throws gr.uoa.di.madgik.grs.writer.GRS2WriterException,
                    org.gcube.indexmanagement.common.IndexException
Executes the query of gRS2 locator of maximum maxHits records (if >0)

Parameters:
queryString -
maxHits -
Returns:
gRS2 locator of the results
Throws:
org.gcube.indexmanagement.common.IndexException
gr.uoa.di.madgik.grs.writer.GRS2WriterException

queryStream

public String queryStream(String queryString)
                   throws org.gcube.indexmanagement.common.IndexException,
                          gr.uoa.di.madgik.grs.writer.GRS2WriterException
Throws:
org.gcube.indexmanagement.common.IndexException
gr.uoa.di.madgik.grs.writer.GRS2WriterException

queryStream

public String queryStream(String queryString,
                          int maxHits)
                   throws org.gcube.indexmanagement.common.IndexException,
                          gr.uoa.di.madgik.grs.writer.GRS2WriterException
Important: The returned results are not sorted!

Parameters:
queryString -
Returns:
gRS2 locator of the results
Throws:
org.gcube.indexmanagement.common.IndexException
gr.uoa.di.madgik.grs.writer.GRS2WriterException

delete

public boolean delete()
Deletes the index and the metaIndex


deleteDocuments

public void deleteDocuments(List<String> docIDs)
Deletes the documents with IDs within the list docIDs

Parameters:
docIDs -

deleteCollection

public Boolean deleteCollection(String collID)
Deletes the documents of the collection with ID collID

Parameters:
docIDs -

commitMeta

public void commitMeta()
Commits the changes to the index by sending a flush and a refresh request


commit

public void commit()

clearIndex

public void clearIndex(String indexTypeName)

close

public void close()
Closes the index


feedRowset

public boolean feedRowset(String rowset)
Feeds the index with a rowset.

Parameters:
rowset -
Returns:
True on success or False on failure

feedLocator

public boolean feedLocator(String resultSetLocation)
                    throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException,
                           URISyntaxException,
                           gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException,
                           gr.uoa.di.madgik.grs.buffer.GRS2BufferException
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException
URISyntaxException
gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException
gr.uoa.di.madgik.grs.buffer.GRS2BufferException

feedLocator

public boolean feedLocator(String resultSetLocation,
                           HashMap<String,org.gcube.indexmanagement.common.FullTextIndexType> colForField)
                    throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException,
                           URISyntaxException,
                           gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException,
                           gr.uoa.di.madgik.grs.buffer.GRS2BufferException
Feeds the index with rowsets that are read from the the given locator

Parameters:
resultSetLocation -
colForField -
Returns:
true if feed was successful, otherwise false
Throws:
gr.uoa.di.madgik.grs.reader.GRS2ReaderException
URISyntaxException
gr.uoa.di.madgik.grs.record.GRS2RecordDefinitionException
gr.uoa.di.madgik.grs.buffer.GRS2BufferException

refreshIndexTypesOfIndex

public void refreshIndexTypesOfIndex()
Refreshes the index types


updateManagerProperties

public boolean updateManagerProperties(HashMap<String,org.gcube.indexmanagement.common.FullTextIndexType> colForIdTypes)

updateManagerPropertiesRemoveCollID

public boolean updateManagerPropertiesRemoveCollID(String collectionID)

addMetaIndex

public boolean addMetaIndex()

invalidateCache

public void invalidateCache()

rebuildMetaIndex

public boolean rebuildMetaIndex(String[] collectionIds,
                                String[] fields)


Copyright © 2013. All Rights Reserved.