mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Remove info hint to reindex khoj on unexpected search results
The index corruption was issue resolved a while ago in #325 and hasn't cropped up again
This commit is contained in:
@@ -127,15 +127,6 @@ export class KhojSearchModal extends SuggestModal<SearchResult> {
|
|||||||
let entry_snipped_indicator = result.entry.split('\n').length > lines_to_render ? ' **...**' : '';
|
let entry_snipped_indicator = result.entry.split('\n').length > lines_to_render ? ' **...**' : '';
|
||||||
let snipped_entry = result.entry.split('\n').slice(0, lines_to_render).join('\n');
|
let snipped_entry = result.entry.split('\n').slice(0, lines_to_render).join('\n');
|
||||||
|
|
||||||
// Show reindex hint on first search result
|
|
||||||
if (this.resultContainerEl.children.length == 1) {
|
|
||||||
let infoHintEl = createEl("div",{ cls: 'khoj-info-hint' });
|
|
||||||
el.insertAdjacentElement("beforebegin", infoHintEl);
|
|
||||||
setTimeout(() => {
|
|
||||||
infoHintEl.setText('Unexpected results? Try re-index your vault from the Khoj plugin settings to fix it.');
|
|
||||||
}, 3000);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show filename of each search result for context
|
// Show filename of each search result for context
|
||||||
el.createEl("div",{ cls: 'khoj-result-file' }).setText(filename ?? "");
|
el.createEl("div",{ cls: 'khoj-result-file' }).setText(filename ?? "");
|
||||||
let result_el = el.createEl("div", { cls: 'khoj-result-entry' })
|
let result_el = el.createEl("div", { cls: 'khoj-result-entry' })
|
||||||
|
|||||||
@@ -174,11 +174,3 @@ If your plugin does not need CSS, delete this file.
|
|||||||
.khoj-result-entry p br {
|
.khoj-result-entry p br {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.khoj-info-hint {
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: var(--font-ui-small);
|
|
||||||
font-style: italic;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 0.5em;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -116,13 +116,11 @@
|
|||||||
// Extract required fields for search from form
|
// Extract required fields for search from form
|
||||||
query = document.getElementById("query").value.trim();
|
query = document.getElementById("query").value.trim();
|
||||||
type = document.getElementById("type").value;
|
type = document.getElementById("type").value;
|
||||||
searchHint = document.getElementById("info-hint");
|
|
||||||
results_count = localStorage.getItem("khojResultsCount") || 5;
|
results_count = localStorage.getItem("khojResultsCount") || 5;
|
||||||
console.log(`Query: ${query}, Type: ${type}, Results Count: ${results_count}`);
|
console.log(`Query: ${query}, Type: ${type}, Results Count: ${results_count}`);
|
||||||
|
|
||||||
// Short circuit on empty query
|
// Short circuit on empty query
|
||||||
if (query.length === 0) {
|
if (query.length === 0) {
|
||||||
searchHint.style.display = "none";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,8 +136,6 @@
|
|||||||
console.log(data);
|
console.log(data);
|
||||||
document.getElementById("results").innerHTML = render_results(data, query, type);
|
document.getElementById("results").innerHTML = render_results(data, query, type);
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => { searchHint.style.display = "block"; }, 3000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function incrementalSearch(event) {
|
function incrementalSearch(event) {
|
||||||
@@ -258,12 +254,6 @@
|
|||||||
<select id="type" class="option" onchange="setTypeFieldInUrl(this)"></select>
|
<select id="type" class="option" onchange="setTypeFieldInUrl(this)"></select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--Add Hints to Guide Search -->
|
|
||||||
<div id="info-hint" style="display: none">
|
|
||||||
Unexpected results? Hit Enter to get better results.
|
|
||||||
Else click Reinitialize on the <a href="/config">settings page</a> to fix it.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Section to Render Results -->
|
<!-- Section to Render Results -->
|
||||||
<div id="results"></div>
|
<div id="results"></div>
|
||||||
</body>
|
</body>
|
||||||
@@ -326,13 +316,6 @@
|
|||||||
#query {
|
#query {
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
}
|
}
|
||||||
#info-hint {
|
|
||||||
font-size: small;
|
|
||||||
color: #aaa;
|
|
||||||
text-align: center;
|
|
||||||
margin: 5px 0 0 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
#results {
|
#results {
|
||||||
font-size: medium;
|
font-size: medium;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|||||||
Reference in New Issue
Block a user