如何在不影响我的span标记的情况下删除li标签的值(How to remove the value of my li tag without affecting my span tag)
我想删除我的li标签(配置文件,事件,照片,通知)中的值,而不会影响span标签,一旦我点击菜单..请...在这需要一些帮助..谢谢!
<nav class="nav navi-tag"> <ul class="font"> <a><li data-button = "btn-navbar" id = "btn1"><span class = "glyphicon glyphicon-list"></span>Profile</li></a> <a><li data-button = "btn-navbar" id = "btn2"><span class = "glyphicon glyphicon-user"></span>Events</li></a> <a><li data-button = "btn-navbar" id = "btn3"><span class = "glyphicon glyphicon-picture"></span>Photos</li></a> <a><li data-button = "btn-navbar" id = "btn4"><span class = "glyphicon glyphicon-envelope"></span>Notification</li></a> </ul> <div class = "font handle">Menu</div> </nav>
我的JS
$('.handle').click(function() { $nav.each(function() { ss = $(this).text(); xx = $('nav ul a li').html().replace(ss, ""); alert(xx); });
I want to remove the value inside of my li tag(Profile, Event, Photos, Notification) without affecting the span tag once i click the menu .. pls.. need some helping hand here.. Thank You!!
<nav class="nav navi-tag"> <ul class="font"> <a><li data-button = "btn-navbar" id = "btn1"><span class = "glyphicon glyphicon-list"></span>Profile</li></a> <a><li data-button = "btn-navbar" id = "btn2"><span class = "glyphicon glyphicon-user"></span>Events</li></a> <a><li data-button = "btn-navbar" id = "btn3"><span class = "glyphicon glyphicon-picture"></span>Photos</li></a> <a><li data-button = "btn-navbar" id = "btn4"><span class = "glyphicon glyphicon-envelope"></span>Notification</li></a> </ul> <div class = "font handle">Menu</div> </nav>
my JS
$('.handle').click(function() { $nav.each(function() { ss = $(this).text(); xx = $('nav ul a li').html().replace(ss, ""); alert(xx); });
原文:https://stackoverflow.com/questions/36386855
最满意答案
如果您使用的是模式版本1.6,Solr将自动从存储的docValues中获取值,即使字段本身设置为
stored="false"
。 在fl
包含字段名称以获取值。但是,即使您正在查找为文档/字段/值索引的实际令牌,使用“分析”页面通常也是首选方法,因为它允许您调整值并快速查看响应。 如果要浏览实际的索引标记, Luke请求处理程序/工具非常有用。
If you're using schema version 1.6, Solr will automagically fetch the values from the stored docValues, even if the field itself is set as
stored="false"
. Include the field name infl
to get the values.However, even if you're looking for the actual tokens indexed for a document / field / value, using the Analysis page is usually the preferred way as it allows you to tweak the value and see the response quickly. The Luke Request Handler / Tool is useful if you want to explore the actual indexed tokens.
相关问答
更多-
您正在看到此行为,因为您要做的第一件事就是清除索引。 solr.Delete(SolrQuery.All) 这将从索引中删除所有文档。 因此,一旦重建索引开始,索引将为空。 现在,在后续代码中,您将批量添加回索引。 但是,在发出提交之前,查询索引的用户将看不到您添加到索引的任何新文档。 由于您正在批量添加文档和发布提交,因此解释了在重建时文档数量增加的原因以及为什么所有文档都不可见。 在最后一次提交发布之前,索引中的计数和总文档数不会是7500。 可能有几个选项可以帮助您缓解这种情况。 使用commitW ...
-
/?q=query&fl=field1,field2,field3 /?q=query&fl=field1,field2,field3
-
Solr太阳黑子非索引字段(Solr Sunspot non-indexed field)[2024-02-04]
太阳黑子的配置DSL支持许多默认类型的选项:stored => true 。 对于存储的字符串的例子,它会比我的第一个例子简单得多: searchable do string :name, :stored => true end 这会生成一个name_ss的字段名称,该名称对应于Sunspot的标准模式中已存在的以下dynamicField :是的,我的解决方案有效! 我将schema.xml中的类型从字符串更改为text_ws,现在我总能得到答案! Yes, my solution works! I changed the type in my schema.xml from string to text_ws and now I always get an answer!你可以检查带有edismax的请求处理程序和默认配置qf ,它将在包含所有字段数据的copyfield上进行搜索。 qf将在其上执行查询的查询字段。 你只需要将一个参数传递给solr qt=edismax&q=K1 K2进行搜索。edismax Solr搜索服务器:如何剥离要索引的内容的HTML实体(Solr search server: How to strip off HTML entities from content to be indexed)[2023-03-09]
在Solr方面你做得很好,唯一应该注意的是Solr存储和Solr索引之间存在差异。 Solr按原样存储数据而不进行任何修改,而在分析器链中,您可以更改Solr索引数据的方式。 所以你实际上告诉Solr从索引中去掉任何html标签,并用相关字符替换html实体,但是Solr会在你提交它们时总是返回它们。 您可以搜索d'Hèrcules或d'Hèrcules d'Hèrcules并且您应该得到相同的结果,因为即使在查询时您已经HtmlStripCharFilterFactory了HtmlStripCha ...如果您使用Solr示例站点的默认设置,那么凭借/select请求处理程序的solrconfig.xml文件中的df设置,它将默认搜索字段设置为text字段。