document.getElementById("searchbar").addEventListener("submit", function(event) {
const stopWords = ["a", "an", "the", "of", "and", "in", "for", "to", "le", "la", "les", "un", "une", "des", "du"];
let searchQuery = document.getElementById("search-input").value.trim();
// Normalize the search query to lowercase to make it case-insensitive
searchQuery = searchQuery.toLowerCase();
// Split the search query into words and filter out stop words and words with 3 or fewer characters
let filteredQuery = searchQuery.split(" ").filter(word =>
!stopWords.includes(word) && word.length > 3
).join(" ");
// Update the input value with the cleaned query
document.getElementById("search-input").value = filteredQuery;