com.ibm.ram.common.data
Class SearchQuery

java.lang.Object
  extended by com.ibm.ram.common.data.SearchQuery
Direct Known Subclasses:
RAMQueryBuilder

public class SearchQuery
extends java.lang.Object

Returns a list of objects from the server. Version 7.1 includes only asset search queries.

Since:
7.1

Field Summary
static int SEARCH_WITHIN_ARTIFACTS_FLAG
          The Search Within Artifacts Bit mask
static int SEARCH_WITHIN_FORUMS_FLAG
          The search within forums bit mask
static int SYNCHRONIZED_SEARCH_FLAG
          Flag to indicate that this should be a synchronized search.
 
Constructor Summary
SearchQuery()
           
 
Method Summary
static java.lang.String escapeLuceneCharacters(java.lang.String s)
          Escapes all special Lucene characters so that they can be used in queries
 int getMaxResults()
          Limits the number of results returned by the this query.
 java.lang.String getQueryString()
           
 int getResultsStartIndex()
          This method is used for paging result sets.
 int getSearchModes()
           
 java.lang.String getSortByField()
           
 boolean isSortAscending()
           
 boolean isThisSearchRecorded()
           
 void setMaxResults(int maxResults)
          Limits the number of results returned by the this query.
 void setQueryString(java.lang.String queryString)
           
 void setResultsStartIndex(int resultsStartIndex)
          This method is used for paging result sets.
 void setSearchModes(int searchModes)
           
 void setSortAscending(boolean sortAscending)
           
 void setSortByField(java.lang.String sortByField)
           
 void setThisSearchRecorded(boolean thisSearchRecorded)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_WITHIN_ARTIFACTS_FLAG

public static final int SEARCH_WITHIN_ARTIFACTS_FLAG
The Search Within Artifacts Bit mask

Since:
7.1.1
See Also:
Constant Field Values

SEARCH_WITHIN_FORUMS_FLAG

public static final int SEARCH_WITHIN_FORUMS_FLAG
The search within forums bit mask

Since:
7.1.1
See Also:
Constant Field Values

SYNCHRONIZED_SEARCH_FLAG

public static final int SYNCHRONIZED_SEARCH_FLAG
Flag to indicate that this should be a synchronized search. Synchronized searches guarantee that the query will search across all assets in the database at the time the search is performed. This is not true of a regular search because the index is normally updated after the database. The downside of a synchronized search is that it may take longer. Example Time 12:30:12 - Asset is submitted to RAM Time 12:30:15 - Query is performed for asset submitted at time 12:30:12 Time 12:30:25 - Asset is added to index. This is due to the delay between updating the database and index. The regular search would not return the asset in the above example. The synchronized search would return the asset, but would take longer to return than the regular search. For best performance, you may want to consider fetching the asset by GUID and version if you already have this information. In the above example, that would yield better performance. session.getAsset(new AssetIdentification("{AC0D54C1-E349-69EC-030F-E51CB557B0D7}", "7.1"));

Since:
7.5.1
See Also:
Constant Field Values
Constructor Detail

SearchQuery

public SearchQuery()
Method Detail

escapeLuceneCharacters

public static java.lang.String escapeLuceneCharacters(java.lang.String s)
Escapes all special Lucene characters so that they can be used in queries

Parameters:
s -
Returns:
String with escaped Lucene characters
Since:
7.1

getMaxResults

public int getMaxResults()
Limits the number of results returned by the this query. The default is 100

Returns:
Returns the maxResults.
Since:
7.1

setMaxResults

public void setMaxResults(int maxResults)
Limits the number of results returned by the this query. The default is 100

Parameters:
maxResults - The maxResults to set.
Since:
7.1

getQueryString

public java.lang.String getQueryString()
Returns:
Returns the queryString.
Since:
7.1

setQueryString

public void setQueryString(java.lang.String queryString)
Parameters:
queryString - The queryString to set.
Since:
7.1

getSearchModes

public int getSearchModes()
Returns:
Returns the searchModes.
Since:
7.1

setSearchModes

public void setSearchModes(int searchModes)
Parameters:
searchModes - The searchModes to set.
Since:
7.1

getSortByField

public java.lang.String getSortByField()
Returns:
Returns the sortByField.
Since:
7.1

setSortByField

public void setSortByField(java.lang.String sortByField)
Parameters:
sortByField - The sortByField to set.
Since:
7.1

isSortAscending

public boolean isSortAscending()
Returns:
Returns the sortAscending.
Since:
7.1

setSortAscending

public void setSortAscending(boolean sortAscending)
Parameters:
sortAscending - The sortAscending to set.
Since:
7.1

isThisSearchRecorded

public boolean isThisSearchRecorded()
Returns:
Returns the thisSearchRecorded.
Since:
7.1

setThisSearchRecorded

public void setThisSearchRecorded(boolean thisSearchRecorded)
Parameters:
thisSearchRecorded - The thisSearchRecorded to set.
Since:
7.1

getResultsStartIndex

public int getResultsStartIndex()
This method is used for paging result sets. By setting this property you would set the index for the first result returned by the query. The query will only return the number of results set by the maxResults property.

Since:
7.1

setResultsStartIndex

public void setResultsStartIndex(int resultsStartIndex)
This method is used for paging result sets. By setting this property you would set the index for the first result returned by the query. The query will only return the number of results set by the maxResults property.

Since:
7.1