Skip to Content
author's profile photo Former Member
Former Member

language dependend search, TREX

Hi,

does anyone know by any chance how one can limit the scope of the results returned by the trex search engine by a particular language, e.g. DE or EN.

If I build my query programmatically using IQueryEntryList, there is no way to specify the language of the document. The only way to get it is to call ISearchResult.getResultLanguage() and then parse the result. This seems to be quite daunting task considering the performance issues. Would really appreciate any response.

Regards,

Ds

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 01, 2004 at 12:55 PM

    Hi Dimitry,

    the problem is that there is no language property predefined in KM. Interesting enough, IResource has a getLanguage() method - so I have been wondering how the language should be determined. Looking into the source (ResourceImpl.class) brought back:

    public String getLanguage() {
      return null;
    }
    

    So far to i8n support...

    I wonder if TREX has the capabilities to determine the language when indexing. Then, you could filter the results. That is not the most efficient way, but better then nothing and should not really be a problem concerning time (a slow TREX won't get much slower 😉).

    The other possibility would be to add a language property to KM docs and have some mechanism to maintain them. This has different advantages, for example you could implement a repository filter just showing docs in the language of the user logged on.

    For you, you could add a QueryEntry checking against this new property.

    The problem is if one already has a thousand documents, how to maintain the language property for these? And how to force users to maintain the property for newly created docs?

    Hope it helps

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2004 at 11:04 AM

    hi just to finish this thread:

    there is a way to implement the language dependent TREX search (rtfjd):

    IFederatedSearch.searchWithSession(IQueryEntryList queryEntryList, IRidList

    searchFromHereList,IResourceContext context, ISortPropertyName sortProperty,

    Set languages) throws WcmException

    ps. to get IRidList of corresponding indexes one can make use of the following method: indexService.getIndex((String)iter.next()).getIndexFolders().getRidList();

    regards,

    ds

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.