Class AutoCompleter


  • public class AutoCompleter
    extends java.lang.Object
    Autocompleter class for initializing and using the autocompletion
    Author:
    Dominik Grimm, Michael Menden, arunans23
    • Constructor Summary

      Constructors 
      Constructor Description
      AutoCompleter​(ObjectStore os)
      Autocompleter build index constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildIndex​(ObjectStore os)
      Build the index from the database blob
      java.lang.String[] getFastList​(java.lang.String query, java.lang.String field, java.lang.String className, int n)
      Returns n search results
      boolean hasAutocompleter​(java.lang.String type, java.lang.String field)
      checks if an autocompletion exists
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AutoCompleter

        public AutoCompleter​(ObjectStore os)
        Autocompleter build index constructor.
        Parameters:
        os - Objectstore
    • Method Detail

      • getFastList

        public java.lang.String[] getFastList​(java.lang.String query,
                                              java.lang.String field,
                                              java.lang.String className,
                                              int n)
        Returns n search results
        Parameters:
        query - is the string used for search
        field - is the field in which you like to search (e.g. name)
        className - is the class in which you like to search (e.g. SOTerm)
        n - number of the first n search results
        Returns:
        string array with search results and an error flag at position 0
      • buildIndex

        public void buildIndex​(ObjectStore os)
                        throws java.io.IOException,
                               ObjectStoreException,
                               java.lang.ClassNotFoundException,
                               org.apache.solr.client.solrj.SolrServerException
        Build the index from the database blob
        Parameters:
        os - Objectstore
        Throws:
        java.io.IOException - IOException
        ObjectStoreException - ObjectStoreException
        java.lang.ClassNotFoundException - ClassNotFoundException
        org.apache.solr.client.solrj.SolrServerException - solr exception
      • hasAutocompleter

        public boolean hasAutocompleter​(java.lang.String type,
                                        java.lang.String field)
        checks if an autocompletion exists
        Parameters:
        type - The name of the class to search.
        field - The name of the field to search for.
        Returns:
        whether an autocompletion exists