Esempio n. 1
0
 /**
  * Trigger addition of a resource to an index Note: the actual operation is performed in
  * background
  */
 public void addSource(IFile resource, IPath containerPath, SourceElementParser parser) {
   if (RubyCore.getPlugin() == null) return;
   SearchParticipant participant = BasicSearchEngine.getDefaultSearchParticipant();
   SearchDocument document = participant.getDocument(resource.getFullPath().toString());
   ((InternalSearchDocument) document).parser = parser;
   IPath indexLocation = computeIndexLocation(containerPath);
   scheduleDocumentIndexing(document, containerPath, indexLocation, participant);
 }
Esempio n. 2
0
 public void indexDocument(
     SearchDocument searchDocument,
     SearchParticipant searchParticipant,
     Index index,
     IPath indexLocation) {
   try {
     ((InternalSearchDocument) searchDocument).index = index;
     searchParticipant.indexDocument(searchDocument, indexLocation);
   } finally {
     ((InternalSearchDocument) searchDocument).index = null;
   }
 }