on 08-05-2009 9:47 AM
Hi All,
I am implementing KM Search using Web Dynpro for Java.
I have created an index in Portal KM and assigned a folder as datasource to it. But when I am searching it through Web Dynpro application, I am not able to view any results.
Following is the code I have written:-
//1. Get User ResourceContext
wdClientUser = WDClientUser.getCurrentUser();
sapUser = wdClientUser.getSAPUser();
ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);
resourceContext = new ResourceContext(ep5User);
//2. Get an object of index management service
indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
//3. Get instance of federated search
federatedSearch = (IFederatedSearch) indexService.getObjectInstance(IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
indexList = indexService.getActiveIndexes();
//4. Build Query Object
sqlBuilder = new SearchQueryListBuilder();
sqlBuilder.setSearchTerm(query);
qeList = sqlBuilder.buildSearchQueryList();
//5. For Searching executions
ISearchSession session = federatedSearch.searchWithSession(qeList,indexList,resourceContext);
ISearchResultList results = session.getSearchResults(1, session.getTotalNumberResultKeys());
ISearchResultListIterator iter = results.listIterator();
//6. Finding individual resources
int count = 0;
ISearchResult result = null;
IResource nresource = null;
while(iter.hasNext()){
result = iter.next();
nresource = result.getResource();
}
Is it something that we can not implement KM API throught Web Dynpro Java view?
What could be reason that API is not able to find any results?
Thanks and regards,
Amey Mogare
APi can be very well use no problem with that as I have used km serach in web dynpro before successfully..Code also looks good at first look.
Pls check @portal if the index is working as expected on folder.
Regards,
Ashok
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashok,
Yes, u were correct. I didnt configured my Index at portal correctly and so was the issue.
Now I am able to get search-results.
Thank you.
Now can you tell me about what all parameters I could get from these search results?
I mean I tried Standard Search URL of portal :-
It shows various other details along with what we get using KM API.
for example: search relevance percentage, seached text etc
How do I get these parameters from API?
Thanks and regards,
Amey Mogare
Check for presmissions on the index and the folders.
Is your WD app using authentication=true parameter?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.