How to do fulltext search with collectionId on Oracle UCM?

804 views Asked by At

How can we make a fulltext search with collectionId on Oracle UCM? Is it possible to do fulltext search supplying recursively start with collectionId parameter? I did some trials (you can take a look below) but if i test with collectionId, there is no result return.

public List<UCMDocumentTemplate> fullTextSearchByFolderId(@WebParam(name = "searchCriteria")
    String paramSearchCriteria, @WebParam(name = "ucmFolderId")
    Long ucmFolderId) throws UCMDocumentSearchException
{
    List<UCMDocumentTemplate> documentTemplateList = new ArrayList<UCMDocumentTemplate>();
    String documentSearchCriteria = "";
    try
    {
        if (ucmFolderId != null)
            documentSearchCriteria = "xCollectionID <= <qsch>" + ucmFolderId + "</qsch> <AND>";
        documentSearchCriteria += "dDocFullText <substring> <qsch>" + paramSearchCriteria + "</qsch>";
        List<Properties> childDocumentList = UCM_API.fullTextSearch(documentSearchCriteria);
        UCMDocumentTemplate ucmDocumentTemplate = null;
        if (childDocumentList != null)
            for (Properties properties : childDocumentList)
            {
                ucmDocumentTemplate = transformToUCMDocumentTemplate(new UCMDocumentTemplate(), properties);
                documentTemplateList.add(ucmDocumentTemplate);
            }
    }
    catch (Exception e)
    {
        UCMDocumentSearchException exc = new UCMDocumentSearchException(documentSearchCriteria, e);
        System.err.println(exc.getCompleteCode());
        e.printStackTrace();
        throw exc;
    }
    return documentTemplateList;
}

public static List<Properties> fullTextSearch(String searchCriteria) throws Exception
{
List<Properties> resultList = null;
List<Field> fields = null;
Properties responseProperties = null;

Properties inputBinderProperties = new Properties();
inputBinderProperties.put("IdcService", "GET_SEARCH_RESULTS");
inputBinderProperties.put("QueryText", searchCriteria);
inputBinderProperties.put("SearchEngineName", "databasefulltext");
inputBinderProperties.put("ResultCount", "500");

DataBinder responseBinder = getExecutedResponseBinder(userName, inputBinderProperties);
DataResultSet resultSet = responseBinder.getResultSet("SearchResults");

fields = resultSet.getFields();
resultList = new ArrayList<Properties>();
for (DataObject dataObject : resultSet.getRows())
{
    responseProperties = new Properties();
    for (Field field : fields)
    {
        if (field.getType() == Field.Type.DATE && dataObject.getDate(field.getName()) != null)
            responseProperties.put(field.getName(), dataObject.getDate(field.getName()));
        else
            responseProperties.put(field.getName(), dataObject.get(field.getName()));
    }
    resultList.add(responseProperties);
}

return resultList;

}

1

There are 1 answers

0
webyildirim On BEST ANSWER

i found a solution. when adding a parameter to inputBinderProperties, it works properly

    inputBinderProperties.put("folderChildren", ucmFolderId);