ITextDocument textDocument = (ITextDocument)document;
//First some text ...
textDocument.getTextService().getText().setText("This is a text content for a search example with NOA.");
//OK - now we need a search query
SearchDescriptor searchDescriptor = new SearchDescriptor("NOA");
searchDescriptor.setIsCaseSensitive(true);
//Perform the search ...
ISearchResult searchResult = textDocument.getSearchService().findFirst(searchDescriptor);
if(!searchResult.isEmpty()) {
//...and now select the result
ITextRange[] textRanges = searchResult.getTextRanges();