Class SearchTask

  • All Implemented Interfaces:
    Runnable, nzilbb.util.MonitorableTask
    Direct Known Subclasses:
    AllUtterancesTask, OneQuerySearch

    public abstract class SearchTask
    extends Task
    Base class for search implementations, which return a set of search results.
    • Constructor Detail

      • SearchTask

        public SearchTask()
    • Method Detail

      • getMatrix

        public Matrix getMatrix()
        Getter for matrix: Matrix that defines this search.
        Returns:
        Matrix that defines this search.
      • setMatrix

        public SearchTask setMatrix​(Matrix newMatrix)
        Setter for matrix: Matrix that defines this search.
        Parameters:
        newMatrix - Matrix that defines this search.
      • getMainParticipantOnly

        public boolean getMainParticipantOnly()
        Getter for mainParticipantOnly: Whether to seearch main-participant utterances only or not.
        Returns:
        Whether to seearch main-participant utterances only or not.
      • setMainParticipantOnly

        public SearchTask setMainParticipantOnly​(boolean newMainParticipantOnly)
        Setter for mainParticipantOnly: Whether to seearch main-participant utterances only or not.
        Parameters:
        newMainParticipantOnly - Whether to seearch main-participant utterances only or not.
      • getSuppressResults

        public boolean getSuppressResults()
        Getter for suppressResults: Whether to suppress the results list (i.e. show only a summary of results)
        Returns:
        Whether to suppress the results list (i.e. show only a summary of results)
      • setSuppressResults

        public SearchTask setSuppressResults​(boolean newSuppressResults)
        Setter for suppressResults: Whether to suppress the results list (i.e. show only a summary of results)
        Parameters:
        newSuppressResults - Whether to suppress the results list (i.e. show only a summary of results)
      • getMatchesPerTranscript

        public Integer getMatchesPerTranscript()
        Getter for matchesPerTranscript: Maximum number of matches per transcript to return, or null for all matches.
        Returns:
        Maximum number of matches per transcript to return, or null for all matches.
      • setMatchesPerTranscript

        public SearchTask setMatchesPerTranscript​(Integer newMatchesPerTranscript)
        Setter for matchesPerTranscript: Maximum number of matches per transcript to return, or null for all matches.
        Parameters:
        newMatchesPerTranscript - Maximum number of matches per transcript to return, or null for all matches.
      • getMaxMatches

        public int getMaxMatches()
        Getter for maxMatches: Maximum total number of matches to return.
        Returns:
        Maximum total number of matches to return, 0 meaning 'no limit'.
      • setMaxMatches

        public SearchTask setMaxMatches​(int newMaxMatches)
        Setter for maxMatches: Maximum total number of matches to return.
        Parameters:
        newMaxMatches - Maximum total number of matches to return, 0 meaning 'no limit'.
      • getOverlapThreshold

        public Integer getOverlapThreshold()
        Getter for overlapThreshold: Percentage overlap with other utterances before simultaeous speech is excluded, or null to include all simultaneous speech.
        Returns:
        Percentage overlap with other utterances before simultaeous speech is excluded, or null to include all simultaneous speech.
      • setOverlapThreshold

        public SearchTask setOverlapThreshold​(Integer newOverlapThreshold)
        Setter for overlapThreshold: Percentage overlap with other utterances before simultaeous speech is excluded, or null to include all simultaneous speech.
        Parameters:
        newOverlapThreshold - Percentage overlap with other utterances before simultaeous speech is excluded, or null to include all simultaneous speech.
      • getAnchorConfidenceThreshold

        public Byte getAnchorConfidenceThreshold()
        Getter for anchorConfidenceThreshold: If non-null, then only targets whose anchors have an alignment status greater than or equals to this value will be returned.
        Returns:
        If non-null, then only targets whose anchors have an alignment status greate than or equals to this value will be returned.
      • setAnchorConfidenceThreshold

        public SearchTask setAnchorConfidenceThreshold​(Byte newAnchorConfidenceThreshold)
        Setter for anchorConfidenceThreshold: If non-null, then only targets whose anchors have an alignment status greater than or equals to this value will be returned.
        Parameters:
        newAnchorConfidenceThreshold - If non-null, then only targets whose anchors have an alignment status greater than or equals to this value will be returned.
      • getRestrictByUser

        public String getRestrictByUser()
        Getter for restrictByUser: The user ID to use to restrict access to search results, if any (e.g. admin users should not have this set).
        Returns:
        The user ID to use to restrict access to search results, if any (e.g. admin users should not have this set).
      • setRestrictByUser

        public SearchTask setRestrictByUser​(String newRestrictByUser)
        Setter for restrictByUser: The user ID to use to restrict access to search results, if any (e.g. admin users should not have this set).
        Parameters:
        newRestrictByUser - The user ID to use to restrict access to search results, if any (e.g. admin users should not have this set).
      • getDescription

        public String getDescription()
        Getter for description: A short, more or less human readable description of the search.
        Returns:
        A short, more or less human readable description of the search.
      • setDescription

        public SearchTask setDescription​(String newDescription)
        Setter for description: A short, more or less human readable description of the search.
        Parameters:
        newDescription - A short, more or less human readable description of the search.
      • getResults

        public SearchResults getResults()
        Getter for results: The results of the search.
        Returns:
        The results of the search.
      • setResults

        public SearchTask setResults​(SearchResults newResults)
        Setter for results: The results of the search.
        Parameters:
        newResults - The results of the search.
      • getWordsContext

        public Integer getWordsContext()
        Getter for wordsContext: Number of words context to specify for the matches page, or null to not specify the 'wordsContext' URL parameter.
        Returns:
        Number of words context to specify for the matches page, or null to not specify the 'wordsContext' URL parameter.
      • setWordsContext

        public SearchTask setWordsContext​(Integer newWordsContext)
        Setter for wordsContext: Number of words context to specify for the matches page, or null to not specify the 'wordsContext' URL parameter.
        Parameters:
        newWordsContext - Number of words context to specify for the matches page, or null to not specify the 'wordsContext' URL parameter.
      • validate

        public String validate()
        Validates the search conditions.
        Returns:
        A message describing a validation error, or null if the conditions are valid
      • run

        public void run()
        Implementors should not override this - it calls search() but also performs various housekeeping operations.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread