cancel
Showing results for 
Search instead for 
Did you mean: 

Search for Custom Properties in a Custom Search Component

Former Member
0 Kudos

Hi all,

i read a lot about the topic in the Forum, but nothing helps.

I developed a custom search component with the help of the Sample from the "Code-Samples" Section. Through this component i have to search for a Custom Property named CP1. I can search for this custom property via the SAP Standard Search Component. Everything works fine. But with my own Search Component it doesnt work.

In the coding of the Search Component i tried the following to Search for the value "Hallo":


private IQueryEntryList createQuery() throws WcmException  
{
      SearchQueryBuilder sqb = new SearchQueryBuilder();
      String thema =  "http://sapportals.com/xmlns/cm:CP1(value=Hallo)"

      sqb.setSelectedCustomProps(thema);


  return sqb.buildSearchQueryEntries();

} 

Everytime i do this dont get back any results. If i comment out this code i got back results.

Is there something wrong with the Namespace "http://sapportals.com/xmlns/cm"? But i created the Property in this Namespace.

Please help!

Accepted Solutions (0)

Answers (1)

Answers (1)

D021954
Advisor
Advisor
0 Kudos

Hi Mark,

please have a look into following note: 933619

Regards Matthias

Former Member
0 Kudos

Hi Matthias,

i had read this note. Does that mean, that i have to create my Query like this:


private IQueryEntryList createQuery() throws WcmException 
{
SearchQueryBuilder sqb = new SearchQueryBuilder();
String thema = "http:??sapportals.com?xmlns?cm:CP1(value=Hallo)"

sqb.setSelectedCustomProps(thema);


return sqb.buildSearchQueryEntries();

} 

Regards Marcus

Former Member
0 Kudos

Hello,

i tried to replace all "/" with ? but it is the same. i dont get back results when i set the SelectedCutomProps of the SearchQueryBuilder object. If i set the SelectedCustomProps to null i got back results.

But i have to search for Documents that have the attribute CP1=Hallo. When i set the SelectedCustomProps of the SearchQueryBuilder to null i'll got back all documents.

How can i search for Documents in the TREX wich have the value "Hallo" in the customProperty "CP1"?

I found this <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=29777">Post</a> and tried to search for a custom Property but it wont work.

Thank you for answers.