Is there a way to programatically full text search?
I am using the RTC SDK to programatically query for work items. I have working code where I can refine my search based on attributes like type, status, and associated project area.
Is there a way to add a full text search attribute into my query?
A boiled down version of my code is as follows:
private static IQueryResult<IResolvedResult<IWorkItem>> performQuery(ITeamRepository repo, String projectAreaName) throws TeamRepositoryException {
final IProcessClientService processClient = (IProcessClientService) repo.getClientLibrary(IProcessClientService.class);
final IQueryClient queryClient = (IQueryClient) repo.getClientLibrary(IQueryClient.class);
final IAuditableClient auditableClient = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
// Connecting to Project Area
final URI uri = URI.create(projectAreaName.replaceAll(" ", "%20"));
final IProjectArea projectArea = (IProjectArea) processClient.findProcessArea(uri, null, monitor);
// Current Project Area
final IQueryableAttribute projectAreaAttribute = findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, monitor);
final AttributeExpression projectAreaExpression = new AttributeExpression(projectAreaAttribute, AttributeOperation.EQUALS, projectArea);
// Escalation Type
final IQueryableAttribute typeAttribute = findAttribute(projectArea, IWorkItem.TYPE_PROPERTY, auditableClient, monitor);
final AttributeExpression typeExpression = new AttributeExpression(typeAttribute, AttributeOperation.MATCHES, "escalation");
final Term term = new Term(Operator.AND);
term.add(projectAreaExpression);
term.add(typeExpression);
final IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE);
return result;
}
Is there a way to add a full text search attribute into my query?
A boiled down version of my code is as follows:
private static IQueryResult<IResolvedResult<IWorkItem>> performQuery(ITeamRepository repo, String projectAreaName) throws TeamRepositoryException {
final IProcessClientService processClient = (IProcessClientService) repo.getClientLibrary(IProcessClientService.class);
final IQueryClient queryClient = (IQueryClient) repo.getClientLibrary(IQueryClient.class);
final IAuditableClient auditableClient = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
// Connecting to Project Area
final URI uri = URI.create(projectAreaName.replaceAll(" ", "%20"));
final IProjectArea projectArea = (IProjectArea) processClient.findProcessArea(uri, null, monitor);
// Current Project Area
final IQueryableAttribute projectAreaAttribute = findAttribute(projectArea, IWorkItem.PROJECT_AREA_PROPERTY, auditableClient, monitor);
final AttributeExpression projectAreaExpression = new AttributeExpression(projectAreaAttribute, AttributeOperation.EQUALS, projectArea);
// Escalation Type
final IQueryableAttribute typeAttribute = findAttribute(projectArea, IWorkItem.TYPE_PROPERTY, auditableClient, monitor);
final AttributeExpression typeExpression = new AttributeExpression(typeAttribute, AttributeOperation.MATCHES, "escalation");
final Term term = new Term(Operator.AND);
term.add(projectAreaExpression);
term.add(typeExpression);
final IQueryResult<IResolvedResult<IWorkItem>> result = queryClient.getResolvedExpressionResults(projectArea, term, IWorkItem.FULL_PROFILE);
return result;
}