Skip to Content
0
Dec 08, 2011 at 02:03 PM

Query Extender not working in Trex Search

36 Views

Hi ,

I have created a Query Extender class with BuildAdditionalQuery method as below.

This class is registered using a portal service and refered in the Index for search.

public IQueryEntryList buildAdditionalQuery(IQueryEntryList qList, IResourceContext context) throws WcmException

{

System.err.println("Start$We are in buildAdditionalQuery; ");

IResource rsc = factory.getResource(pathRID ,resourseContext);

IPropertyName publishDateProp = new PropertyName("http://sapportals.com/xmlns/cm","hei_publish_date");

IQueryEntryList returnList = qList.createEmptyQueryEntryList();

String currentDate = new Date().toString();

returnList.addAttributeQuery(publishDatePropcurrentDate,IQueryEntry.PROPERTY_OPERATOR_LESS_OR_EQUAL);

//returnList.addAttributeQuery(lPublishDateProp,currentDate,IQueryEntry.PROPERTY_OPERATOR_LESS_OR_EQUAL);

// returnList.addContentQuery("Test");

// returnList.addOrOperator();

// returnList.addContentQuery("SAP");

System.err.println("End>We are in buildAdditionalQuery; ");

return returnList;

}

This above method is getting called when I search for documents in Portal as I could see the error trace in default trace. But it doesn't bring any results though the custom property hei_publish_date of type timestamp in the document has some date value earlier than current date.

The search also doesn't work if I try another custom property hei_source_news of type String with a specific value as "XXX" in buildAdditionalQuery.

Can you please help me to resolve the issue.

Thanks,

Siva