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:
Debanjum Singh Solanky 2023-08-15 22:15:48 -07:00
parent def909a913
commit 26c3977fb9
3 changed files with 0 additions and 34 deletions

View file

@ -127,15 +127,6 @@ export class KhojSearchModal extends SuggestModal<SearchResult> {
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');
// 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
el.createEl("div",{ cls: 'khoj-result-file' }).setText(filename ?? "");
let result_el = el.createEl("div", { cls: 'khoj-result-entry' })

View file

@ -174,11 +174,3 @@ If your plugin does not need CSS, delete this file.
.khoj-result-entry p br {
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;
}

View file

@ -116,13 +116,11 @@
// Extract required fields for search from form
query = document.getElementById("query").value.trim();
type = document.getElementById("type").value;
searchHint = document.getElementById("info-hint");
results_count = localStorage.getItem("khojResultsCount") || 5;
console.log(`Query: ${query}, Type: ${type}, Results Count: ${results_count}`);
// Short circuit on empty query
if (query.length === 0) {
searchHint.style.display = "none";
return;
}
@ -138,8 +136,6 @@
console.log(data);
document.getElementById("results").innerHTML = render_results(data, query, type);
});
setTimeout(() => { searchHint.style.display = "block"; }, 3000);
}
function incrementalSearch(event) {
@ -258,12 +254,6 @@
<select id="type" class="option" onchange="setTypeFieldInUrl(this)"></select>
</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 -->
<div id="results"></div>
</body>
@ -326,13 +316,6 @@
#query {
font-size: larger;
}
#info-hint {
font-size: small;
color: #aaa;
text-align: center;
margin: 5px 0 0 0;
padding: 0;
}
#results {
font-size: medium;
margin: 0px;