配置Solr用于暗示/预测自动完成搜索(Configuring Solr for Suggestive/Predictive Auto Complete Search)
我们正在努力将Solr 3.6集成到电子商务网站。 我们有索引数据和搜索表现非常好。
我们在确定如何使用Predictive Search / Auto Complete Search建议方面遇到了一些困难。 还有兴趣了解实现此功能的最佳实践。
我们的目标是提供类似于http://www.amazon.com/的预测搜索,但不知道如何使用Solr实现它。 更具体地说,我想了解如何从Solr构建这些术语,还是由solr外部的其他东西管理? 如何建立字典以提供这些建议? 此外,对于某些领域,搜索应该提供在类别中搜索。 尝试在亚马逊搜索框中键入“xper”,你会注意到除了xperia,xperia s,xperia p之外,它还列出了手机和配件中的xperia s,这是一个类别。
使用自定义词典这将很难管理。 或者我们可能不知道如何正确地做到这一点。 期待您指导我们如何最好地利用solr来实现这种暗示搜索。
We are working on integrating Solr 3.6 to an eCommerce site. We have indexed data & search is performing really good.
We have some difficulties figuring how to use Predictive Search / Auto Complete Search Suggestion. Also interested to learn the best practices for implementing this feature.
Our goal is to offer predictive search similar to http://www.amazon.com/, but don't know how to implement it with Solr. More specifically I want to understand how to build those terms from Solr, or is it managed by something else external to solr? How the dictionary should be built for offering these kind of suggestions? Moreover, for some field, search should offer to search in category. Try typing "xper" into Amazon search box, and you will note that apart from xperia, xperia s, xperia p, it also list xperia s in Cell phones & accessories, which is a category.
Using a custom dictionary this would be difficult to manage. Or may be we don't know how to do it correctly. Looking to you to guide us on how best utilize solr to achieve this kind of suggestive search.
原文:https://stackoverflow.com/questions/12215537
最满意答案
你有一个id被定义为
@+id/1
。1
不会生成有效的Java标识符,因此是错误。 出于同样的原因,不能创建名称以数字开头或包含空格或匹配保留关键字的id或资源。You have an id somewhere defined as
@+id/1
.1
does not make for a valid Java identifier, hence the error. For that same reason, one cannot create ids or resources which name starts with a number, or contains spaces, or matches a reserved keyword.
相关问答
更多-
首先检查资源文件是否有错误。 如果是这种情况,则不会生成R.java。 检查你是否已经更新你的adt到rev 22.如果是这样,请按照下面的步骤操作 右键单击您的项目转到属性。 Java构建路径。 选择订单导出选项卡。 确保已选择Android专用库。 如果你有引用库项目。 也为图书馆项目做同样的事情。 清洁和构建。 还转到android sdk管理器,并检查您是否安装了android sdk构建工具。 这很多不是必要的,但要确保你已经安装了android构建工具。 检查下面的链接 Eclipse错误:R无 ...
-
Intellij版本的“clean”称为“Rebuild Project”。 它位于Build菜单中。 The Intellij version of "clean" is called "Rebuild Project". It's in the Build menu.
-
我不确定gcm_unregistered应该是什么,但我建议不要编辑R类,因为它生成了。 如果您想在Resources(R)中添加一些内容,请通过xml完成。 用于操纵/访问资源的Android网站http://developer.android.com/guide/topics/resources/accessing-resources.html 编辑:所以你想添加一个字符串资源,然后转到res / values /下的strings.xml,并添加gcm_unregistered和你想要的值。 I'm ...
-
您可以创建一个新项目,然后将所有类和资源从“src”和“res”文件夹复制到新项目,然后您可以构建新项目。 You can make a new project and then copy all classes and resources from "src" and "res" folder to new project, then you can build your new project.
-
你有一个id被定义为@+id/1 。 1不会生成有效的Java标识符,因此是错误。 出于同样的原因,不能创建名称以数字开头或包含空格或匹配保留关键字的id或资源。 You have an id somewhere defined as @+id/1. 1 does not make for a valid Java identifier, hence the error. For that same reason, one cannot create ids or resources which name ...
-
R.java发生故障(R.java malfunctioning)[2023-06-14]
查看代码的“导入”部分。 由于您删除了原始R,因此Eclipse可能会帮助您填写R作为com.android.R而不是com.yourproject.R 我有时也会遇到Eclipse Resource的问题,有时我发现关闭并且“自动buiild”功能可能有所帮助,或者只是重启Eclipse有时可能有所帮助。 这是Mac OS下的一种小车。 Look at the 'import' section of your code. Since you deleted your original R, chances ... -
如果它不起作用并且你认为你已经尝试了所有的东西,那么先吹掉你的eclipse安装(卸载并重新安装)。 如果删除并重新安装插件不起作用,请重命名~/.eclipse文件夹并重新开始。 如果这不起作用,请删除工作区中的.metadata文件夹...然后重新开始。 (您将不得不重新导入所有项目) 从存储库安装Eclipse(我正在使用eclipse来自软件中心和openJDK)。 如果您正在运行x64: sudo apt-get install ia32-libs-multiarch 作为root启动eclips ...
-
检查strings.xml文件的编码,确保它是UTF-8 。 Check for the encoding of your strings.xml file, ensure it is UTF-8.
-
R.Java id错误(R.Java id error)[2022-03-10]
您能否查看一下您的xml文件,看看您是否拥有所有id等的正确命名约定。 我在考虑这些类型的命名错误: android:id="@+id/text-view-example" 并将它们重命名为: android:id="@+id/text_view_example" 要么 右键单击左侧面板(android-view)中的“app”,然后单击“在路径中查找”,然后键入确切的查询login_user-fb ,然后将其替换为login_user_fb 。 Could you please check thr ... -
R.java错误“;(R.java error “; ” expected)[2022-05-26]
您可以尝试清理并重建项目。 应重新创建R.java文件。 如果这不起作用,你可以尝试找到失踪者; 我希望能解决这个问题。 You can try to clean and rebuild you project. The R.java file should be recreated. And if this does not work you can try to find the missing ;. I hope that solves the problem.