首页 \ 问答 \ 如何使用rspec测试Thinking Sphinx delta索引(How to test Thinking Sphinx delta indexes using rspec)

如何使用rspec测试Thinking Sphinx delta索引(How to test Thinking Sphinx delta indexes using rspec)

我在我的项目中使用了Thinking sphinx,并使用Rspec测试用于我的搜索功能,使用类似于此处的设置

我在我的项目中也使用了大量的Delta索引。 如何在此使用rspec测试delta索引结果。


I have used Thinking sphinx in my project and have test cases using Rspec for my search functionalities using setup similar to here

I have also used extensive Delta indexing in my project. How can I test my delta indexed results using rspec here.


原文:https://stackoverflow.com/questions/14599275
更新时间:2021-02-15 10:02

最满意答案

我不确定上述评论的目的是什么 - 这个特殊问题对我来说似乎很清楚(也很常见)。

谷歌现在可以做很多事情来索引JS应用程序,但大部分都试图对延迟加载的内容敏感。 今天有许多站点将注释流,侧边栏小部件,有时甚至是主要内容等内容加载到空页面shell中作为单独的资源。 如果没有具体说明他们做了什么,Google暗示的是他们现在非常擅长处理这类事情。

这并不意味着他们将真正运用您的应用程序,而在SPA中,风险非常高,他们不会发现您希望他们做的所有事情。 这是一个架构问题,您需要回到您的数据模型,您比其他人更了解。 最好的结果将来自使用服务器端代码(通常在批处理作业中)从原始数据模式生成sitemap.xml。 您可以生成您知道应用将响应的所有网址,并将网站地图设置为准确反映您希望将应用编入索引的方式。

然后,Google可以点击每个页面,您需要做的就是确保这些页面无需进一步交互即可运行。 这样他们就不必在应用页面中跟踪链接。


I'm not sure what the purpose of the above comment is - this particular question seems pretty clear (and common) to me.

Google can do a lot to index JS apps now but most of it is trying to be sensitive to lazy-loaded content. There are many sites today that load things like comment streams, sidebar widgets, and sometimes even primary content into an empty page shell as a separate resource. Without making specific statements about exactly what they do, what Google has implied is that they're pretty good at dealing with this type of thing now.

That doesn't mean they're going to actually exercise your app, and in an SPA the risk is very high that they won't discover everything you want them to do. This is an architectural problem that you need to take back to your data model, which you know better than anybody else. Your best result is going to come from using server-side code (usually in a batch job) to generate a sitemap.xml from your raw data schema. You can generate all the URLs you know your app will respond to and set the sitemap up to accurately reflect the way you want your app indexed.

Google can then hit each of those pages, and all you need to do is make sure that when they do, those pages will work without further interaction. That way they don't have to follow links within the app pages themselves.

相关问答

更多
  • 从索引中删除正文内容并将其放在单独的文件(home.html)中。 只需在身体中添加一个ui-view。 默认情况下,在运行块路由到登录页面。 使用$state.go('home')登录成功路由到主页。 将选项卡路由命名为home.tab1,将home.tab2命名为嵌套路由。 Remove the body content from index and put it in a separate file(home.html). Just add a ui-view in the body. In run ...
  • 对于可能有类似问题的其他人: 我能够通过将web.config添加到/appname目录并添加以下配置来解决此问题。
  • 您不能直接使用剃刀视图作为角模板。 Razor视图由ASP.NET编译,而不是由Web服务器直接作为静态文件提供,而Angular模板通过http异步加载或通过angulars templatecache检索。 你有两个选择。 不要使用剃刀视图(即.cshtml文件)作为角模板。 改为使用常规的.html文件。 引用ASP.NET MVC操作,而不是静态文件。 在你的情况下(假设默认路由配置)你的templateUrl应该是/Home/Test 。 我推荐第一个选项,并保持ASP.NET MVC剃刀视图与a ...
  • 我不确定上述评论的目的是什么 - 这个特殊问题对我来说似乎很清楚(也很常见)。 谷歌现在可以做很多事情来索引JS应用程序,但大部分都试图对延迟加载的内容敏感。 今天有许多站点将注释流,侧边栏小部件,有时甚至是主要内容等内容加载到空页面shell中作为单独的资源。 如果没有具体说明他们做了什么,Google暗示的是他们现在非常擅长处理这类事情。 这并不意味着他们将真正运用您的应用程序,而在SPA中,风险非常高,他们不会发现您希望他们做的所有事情。 这是一个架构问题,您需要回到您的数据模型,您比其他人更了解。 ...
  • 我做了类似的事情。 我正在使用Asp.net MVC和WebApi与AngularJS 。 我的第一个请求是MVC Action - >它返回一种母版页(包括bundle)。 当页面下载到客户端时, AngularJS开始并负责。 现在我的模板视图也通过Razor视图引擎呈现(因为我需要一个特殊的内部引擎来定位我的相关模板) - 我可以使用bundle和其他.net内部而不是获取普通的html。 现在使用模板这种方式可能很糟糕 。 我把Razor视图引擎在这个过程中做了什么。 在项目中使用Razor vie ...
  • 这种方法没有任何问题,我最近在一个应用程序中看到它已经工作了几年并且它工作得很好,虽然它是前端的ReactJs,但它并不是真的物。 如果我打算使用更复杂的应用程序来运行大量微服务以获得最大的正常运行时间和容错能力,我会单独部署它们。 例如,Netflix将有一个微服务,如果服务可用,它会为您提供推荐电影的列表,但它会回退到预定义列表(另一个微服务)。 前端会询问来自一方的数据,如果失败则会使用其他服务。 当然,您可以使用单个部署的多个服务器,但这限制了我独立扩展它们的能力。 例如,从CDN提供SPA并仅部署 ...
  • express-sitemap遍历所有已注册的路由以生成站点地图。 在内部调用: app._router.stack然后过滤所有路由。 您应该明确地将您的帖子注册为路由而不是使用参数。 改为: posts.forEach(function(post) { app.get('/' + post.url, function(req, res, next) { res.render('post', { posts2: post }); // your logic... ...
  • 首先你必须了解SPA和MPA的优点/缺点。 MPA是传统的方法,其中每个页面在每次请求时都完全呈现,并且在SPA中页面的需求部分被重新加载。 基本上SPA =(MPA + ajax)是指基于UI框架而不是服务器的SPA。 所以性能明智的SPA比MPA更可靠。 但是,您可以使用混合方法也可以用于任何特殊页面(如图表,SVG,图表),您可以拥有另一个具有复杂且不同类型的设计和数据的页面。 First of all you have to understand the advantages/disadvantag ...
  • AngularJS已经为单页应用(SPA)网站创建。 但这并不限制创建非SPA网站或应用程序。 如果已在其应用程序中包含路由,则它将生成SPA应用程序。 我使用AngularJS作为脚本框架开发了各种应用程序,其中一些是SPA,一些是非SPA。 实际上,开发人员或应用程序决定使用SPA还是不使用SPA。 AngularJS has been created for Single Page App (SPA) website. But this doesn't restricts one from creat ...
  • 查看此工作演示: var app = angular.module('Routing', []); app .controller('HomeController', function ($scope) {}); app .controller('AboutController', function ($scope) {}); app .config(function ($routeProvider) { $routeProvider. when('/hom ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)