Showing results for 
Search instead for 
Did you mean: 

Search with session at TREX in a Java App

Former Member
0 Kudos

Hi all.

I´m doing a program to search at the KM with TREX and I found out that when I do the search with session, I don´t get the results containing the search keywords in the content; I mean:

File 1 -> Name: test.txt / Content: "this is a file"

File 2 -> Name: file.txt / Content: "this is a test"

If I search "test" I´ll get the File 1, but not the File 2 too.

If I try with a search without session, I get both. Do you know why??

Here is my code:

IIndexService indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
SearchQueryListBuilder sqb = new SearchQueryListBuilder();
IQueryEntryList qel = sqb.buildSearchQueryList();
IFederatedSearch federatedSearch = (IFederatedSearch) indexService.getObjectInstance(IWcmIndexConst.FEDERATED_SEARCH_INSTANCE);
List indexList = new ArrayList();
indexList = indexService.getActiveIndexes();
session = federatedSearch.searchWithSession(qel, indexList, c);
rawResults = session.getSearchResults(currentResultIndex, finalResultIndex);

Thanks a lot in advance...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It seems I was wrong... Indexing problem?? Maybe but... Solved.