i want to use the suggestion feature of MarkLogic database in conjunction with the Java Client API.
The problem with that is, to do a suggest call i need a field or something that serves as a suggestion source. The next step is to create query options that reference this suggestion source. The last step is to call:
SuggestionDefinition def = marklogicClient.newQueryManager().newSuggestionDefinition();
def.setLimit(10);
def.setOptionsName("my-query-options");
def.setStringCriteria("Test");
//setup lang?
The question is: How to switch language? If my frontend can be switched between german and english, then i have to switch the search/suggest language. In order to do this i have to switch the collation but how?
The query options are static after upload, containing something like:
<default-suggestion-source>
<word collation="http://marklogic.com/collation/de">
<field name="my-suggest" />
</word>
</default-suggestion-source>