mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Clicking Update Index in Obsidian settings should push files to index
Use the indexer/batch API endpoint to regenerate content index rather than the previous pull based content indexing API endpoint
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { App, Notice, PluginSettingTab, request, Setting, TFile } from 'obsidian';
|
import { App, Notice, PluginSettingTab, request, Setting, TFile } from 'obsidian';
|
||||||
import Khoj from 'src/main';
|
import Khoj from 'src/main';
|
||||||
|
import { updateContentIndex } from './utils';
|
||||||
|
|
||||||
export interface KhojSetting {
|
export interface KhojSetting {
|
||||||
enableOfflineChat: boolean;
|
enableOfflineChat: boolean;
|
||||||
@@ -120,8 +121,9 @@ export class KhojSettingTab extends PluginSettingTab {
|
|||||||
}, 300);
|
}, 300);
|
||||||
this.plugin.registerInterval(progress_indicator);
|
this.plugin.registerInterval(progress_indicator);
|
||||||
|
|
||||||
await request(`${this.plugin.settings.khojUrl}/api/update?t=markdown&force=true&client=obsidian`);
|
this.plugin.settings.lastSyncedFiles = await updateContentIndex(
|
||||||
await request(`${this.plugin.settings.khojUrl}/api/update?t=pdf&force=true&client=obsidian`);
|
this.app.vault, this.plugin.settings, this.plugin.settings.lastSyncedFiles, true
|
||||||
|
);
|
||||||
new Notice('✅ Updated Khoj index.');
|
new Notice('✅ Updated Khoj index.');
|
||||||
|
|
||||||
// Reset button once index is updated
|
// Reset button once index is updated
|
||||||
|
|||||||
Reference in New Issue
Block a user