A search pattern defines how search results are found. Use
SearchPattern.createPattern
to create a search pattern.
Search patterns are used during the search phase to decode index entries that were added during the indexing phase (see {@link SearchDocument#addIndexEntry(char[],char[])}). When an index is queried, the index categories and keys to consider are retrieved from the search pattern using {@link #getIndexCategories()} and{@link #getIndexKey()}, as well as the match rule (see {@link #getMatchRule()}). A blank pattern is then created (see {@link #getBlankPattern()}). This blank pattern is used as a record as follows. For each index entry in the given index categories and that starts with the given key, the blank pattern is fed using {@link #decodeIndexKey(char[])}. The original pattern is then asked if it matches the decoded key using {@link #matchesDecodedKey(SearchPattern)}. If it matches, a search document is created for this index entry using {@link SearchParticipant#getDocument(String)}.
This class is intended to be sub-classed by clients. A default behavior is provided for each of the methods above, that clients can override if they wish.
@see #createPattern(org.eclipse.jdt.core.IJavaElement,int)
@see #createPattern(String,int,int,int)
@since 3.0