建筑设计资料网站wordpress根目录在哪

张小明 2026/1/9 5:49:49
建筑设计资料网站,wordpress根目录在哪,贵州省中海工程建设有限公司网站,网站高端网站建设欢迎大家加入开源鸿蒙跨平台开发者社区#xff0c;一起共建开源鸿蒙跨平台生态。 全文搜索系统概述 全文搜索功能允许用户快速查找应用中的任何内容。在Cordova框架与OpenHarmony系统的结合下#xff0c;我们需要实现一个高效的搜索系统#xff0c;支持多种搜索类型和过滤选…欢迎大家加入开源鸿蒙跨平台开发者社区一起共建开源鸿蒙跨平台生态。全文搜索系统概述全文搜索功能允许用户快速查找应用中的任何内容。在Cordova框架与OpenHarmony系统的结合下我们需要实现一个高效的搜索系统支持多种搜索类型和过滤选项。搜索引擎数据模型classSearchIndex{constructor(){this.indexnewMap();// 关键词 - 结果数组this.buildIndex();}buildIndex(){// 索引植物plants.forEach(plant{this.addToIndex(plant.name,{type:plant,data:plant});this.addToIndex(plant.species,{type:plant,data:plant});});// 索引分类categoryManager.categories.forEach(cat{this.addToIndex(cat.name,{type:category,data:cat});});// 索引标签tagManager.tags.forEach(tag{this.addToIndex(tag.name,{type:tag,data:tag});});}addToIndex(keyword,result){constkeykeyword.toLowerCase();if(!this.index.has(key)){this.index.set(key,[]);}this.index.get(key).push(result);}search(keyword){constkeykeyword.toLowerCase();constresults[];// 精确匹配if(this.index.has(key)){results.push(...this.index.get(key));}// 模糊匹配for(const[indexKey,indexResults]ofthis.index.entries()){if(indexKey.includes(key)indexKey!key){results.push(...indexResults);}}returnresults;}}这个搜索引擎数据模型定义了SearchIndex类。它建立了一个倒排索引支持精确匹配和模糊匹配。与OpenHarmony搜索服务的集成functionperformFullTextSearch(keyword){cordova.exec(function(result){console.log(搜索完成);renderSearchResults(result);},function(error){console.error(搜索失败:,error);},SearchPlugin,search,[{keyword:keyword,searchTypes:[plants,categories,tags,records],limit:50}]);}functionindexContent(){cordova.exec(function(result){console.log(内容已索引);},function(error){console.error(索引失败:,error);},SearchPlugin,indexContent,[{plants:plants,categories:categoryManager.categories,tags:tagManager.tags}]);}这段代码展示了如何与OpenHarmony的搜索服务集成。performFullTextSearch函数执行搜索indexContent函数建立索引。搜索结果展示functionrenderSearchResults(results){constcontainerdocument.getElementById(page-container);container.innerHTMLdiv classsearch-results-container h2搜索结果/h2 p找到${results.length}个结果/p /div;if(results.length0){container.innerHTMLp classempty-message未找到匹配的结果/p;return;}// 按类型分组结果constgroupedResults{};results.forEach(result{if(!groupedResults[result.type]){groupedResults[result.type][];}groupedResults[result.type].push(result);});// 渲染每个类型的结果Object.keys(groupedResults).forEach(type{consttypeResultsgroupedResults[type];consttypeSectiondocument.createElement(div);typeSection.classNameresult-type-section;typeSection.innerHTMLh3${getTypeLabel(type)}(${typeResults.length})/h3;typeResults.forEach(result{constresultItemdocument.createElement(div);resultItem.classNameresult-item;if(result.typeplant){resultItem.innerHTMLh4${result.data.name}/h4 p物种:${result.data.species}/p p位置:${result.data.location}/p button onclickviewPlantDetails(${result.data.id})查看/button;}elseif(result.typecategory){resultItem.innerHTMLh4${result.data.name}/h4 p${result.data.description}/p button onclickviewCategory(${result.data.id})查看/button;}elseif(result.typetag){resultItem.innerHTMLh4${result.data.name}/h4 p使用次数:${result.data.usageCount}/p button onclickviewTag(${result.data.id})查看/button;}typeSection.appendChild(resultItem);});container.appendChild(typeSection);});}functiongetTypeLabel(type){constlabels{plant: 植物,category: 分类,tag:️ 标签,record: 记录};returnlabels[type]||type;}这个函数负责渲染搜索结果。结果按类型分组展示用户可以快速查看不同类型的搜索结果。搜索页面functionrenderSearchPage(){constcontainerdocument.getElementById(page-container);container.innerHTMLdiv classsearch-page div classsearch-header h2全文搜索/h2 div classsearch-box input typetext idsearch-input placeholder搜索植物、分类、标签... button onclickexecuteSearch() 搜索/button /div /div div classsearch-filters label input typecheckbox idfilter-plants checked 植物 /label label input typecheckbox idfilter-categories checked 分类 /label label input typecheckbox idfilter-tags checked 标签 /label label input typecheckbox idfilter-records checked 记录 /label /div div idsearch-results/div /div;document.getElementById(search-input).addEventListener(keypress,function(e){if(e.keyEnter){executeSearch();}});}functionexecuteSearch(){constkeyworddocument.getElementById(search-input).value;if(!keyword){showToast(请输入搜索关键词);return;}constfilters{plants:document.getElementById(filter-plants).checked,categories:document.getElementById(filter-categories).checked,tags:document.getElementById(filter-tags).checked,records:document.getElementById(filter-records).checked};performFullTextSearch(keyword);}这个函数创建搜索页面包括搜索框和过滤选项。用户可以输入关键词并选择搜索类型。搜索历史管理classSearchHistory{constructor(maxHistory20){this.history[];this.maxHistorymaxHistory;this.loadFromStorage();}addSearch(keyword){// 移除重复的搜索this.historythis.history.filter(hh!keyword);// 添加到开头this.history.unshift(keyword);// 保持历史记录数量在限制内if(this.history.lengththis.maxHistory){this.history.pop();}this.saveToStorage();}getHistory(){returnthis.history;}clearHistory(){this.history[];this.saveToStorage();}}这个SearchHistory类管理用户的搜索历史。用户可以查看之前的搜索并快速重复搜索。搜索建议功能functiongetSearchSuggestions(keyword){constsuggestions[];// 从植物名称获取建议plants.forEach(plant{if(plant.name.toLowerCase().includes(keyword.toLowerCase())){suggestions.push({text:plant.name,type:plant,icon:});}});// 从分类获取建议categoryManager.categories.forEach(cat{if(cat.name.toLowerCase().includes(keyword.toLowerCase())){suggestions.push({text:cat.name,type:category,icon:});}});// 从标签获取建议tagManager.tags.forEach(tag{if(tag.name.toLowerCase().includes(keyword.toLowerCase())){suggestions.push({text:tag.name,type:tag,icon:️});}});returnsuggestions.slice(0,10);// 返回前10个建议}functionrenderSearchSuggestions(suggestions){constsuggestionsListdocument.createElement(div);suggestionsList.classNamesuggestions-list;suggestions.forEach(suggestion{constitemdocument.createElement(div);item.classNamesuggestion-item;item.innerHTMLspan classsuggestion-icon${suggestion.icon}/span span classsuggestion-text${suggestion.text}/span;item.onclick(){document.getElementById(search-input).valuesuggestion.text;executeSearch();};suggestionsList.appendChild(item);});returnsuggestionsList;}这段代码实现了搜索建议功能。当用户输入时系统会显示相关的建议帮助用户快速找到所需内容。搜索统计classSearchStatistics{constructor(searchHistory){this.searchHistorysearchHistory;}getMostSearchedKeywords(limit10){constcounts{};this.searchHistory.history.forEach(keyword{counts[keyword](counts[keyword]||0)1;});returnObject.entries(counts).sort((a,b)b[1]-a[1]).slice(0,limit).map(([keyword,count])({keyword,count}));}getSearchTrends(){returnthis.searchHistory.history.slice(0,20);}}这个SearchStatistics类提供了搜索的统计功能。getMostSearchedKeywords返回最常搜索的关键词getSearchTrends返回最近的搜索趋势。总结全文搜索功能是植物养护应用的重要功能。通过高效的搜索引擎和与OpenHarmony搜索服务的集成我们可以创建一个功能完整的搜索系统帮助用户快速找到所需的信息。
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

网络技术课程谷歌seo服务

AI写论文平台排名:9个实测,开题报告论文降重都好用工具对比排名表格工具名称核心功能突出优势Aibiye降AIGC率适配高校规则,AI痕迹弱化Aicheck论文降重速度快,保留专业术语Askpaper论文降重逻辑完整性好秘塔写作猫智能降重结合语法…

张小明 2026/1/9 5:56:49 网站建设

知名网站建设商家广州建网站比较有名的公司

除安全更新外,EN 18031-1 作为欧盟 RED 指令下的核心网络安全标准,还明确了访问控制与身份验证、安全存储与通信、网络弹性、技术文档与合规声明四大核心要求,这些要求与安全更新共同构成设备进入欧盟市场的基础安全基线,具体内容…

张小明 2026/1/7 19:41:34 网站建设

南昌自主建站模板wordpress 分享至微信

北京地区矢量地图Shp格式数据为开发者和数据分析师提供了完整的GIS分析解决方案,涵盖了商业、交通、公共机构、乡镇信息等多个维度的地理数据。这份免费开源的数据资源能够快速集成到ArcGIS等主流GIS软件中,助力空间分析和决策支持。 【免费下载链接】北…

张小明 2026/1/7 19:41:03 网站建设

赤峰市哪里做网站网站建设迁移方案

第一章:【独家】Open-AutoGLM核心团队访谈:揭秘开源背后的技术决策与未来布局在与Open-AutoGLM核心团队的深度对话中,我们首次揭开了这一开源项目背后的架构设计哲学与战略考量。项目负责人李哲强调:“我们的目标不是复刻现有框架…

张小明 2026/1/7 19:40:31 网站建设

网站建设模板坏处海南海口网站开发公司

随着移动互联网与物联网技术的全面普及,我们计划深度整合物联网、传感检测、云计算及大数据分析等前沿技术,搭建一体化智慧厕所管理平台。通过创新管理模式,实现公共厕所的智能化监测、精细化运营与高效管理,打通线上线下服务壁垒…

张小明 2026/1/7 19:39:59 网站建设

一家做公司点评的网站郑州企业网站优化服务哪家好

三菱 FX5U PLC 4轴程序。控制松下伺服3个, 步进电机一个, 四轴自动堆垛码垛设备程序, 回原点动作用专用的原点回归指令写的, 手动运行用三菱相对定位指令写的 , 自动运行用绝对定位指令写的取料运行, 表格定…

张小明 2026/1/7 19:39:27 网站建设