热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

关于SOLR文档的问题等等-QuestionsaboutSOLRdocumentsandsomemore

Website:Classifiedswebsite(usersmayputads,searchadsetc)网站:分类广告网站(用户可以投放广告,搜索广告等)Iplant

Website: Classifieds website (users may put ads, search ads etc)

网站:分类广告网站(用户可以投放广告,搜索广告等)

I plan to use SOLR for searching and then return results as ID nr:s only, and then use those ID nr:s and query mysql, and then lastly display the results with those ID:s.

我打算使用SOLR进行搜索,然后将结果作为ID nr:s返回,然后使用那些ID nr:s并查询mysql,最后用这些ID显示结果:s。

Currently I have around 30 tables in MySQL, one for each category.

目前我在MySQL中有大约30个表,每个类别一个。

1- Do you think I should do it differently than above?

1-你认为我应该采取与上述不同的方式吗?

2- Should I use only one SOLR document, or multiple documents? Also, is document the same as a SOLR index?

2-我应该只使用一个SOLR文档还是多个文档?此外,文档是否与SOLR索引相同?

3- Would it be better to Only use SOLR and skip MySQL knowing that I have alot of columns in each table? Personally I am much better at using MySQL than SOLR.

3-仅使用SOLR并跳过MySQL知道我在每个表中有很多列会更好吗?就个人而言,我比使用SOLR更善于使用MySQL。

4- Say the user wants to search for cars in a specific region, how is this type of querying performed/done in SOLR? Ex: q=cars®ion=washington possible?

4-假设用户想要搜索特定区域的汽车,在SOLR中如何执行/完成此类查询?例如:q =汽车和地区=华盛顿可能吗?

You may think there is alot of info about SOLR out there, but there isn't, and especially not about using PHP with SOLR and a SOLR php client... Maybe I will write something when I have learned all this... Or maybe one of you could write something up!

您可能认为有很多关于SOLR的信息,但是没有,特别是没有使用PHP与SOLR和SOLR php客户端...也许我会在我学会了这些之后写些东西...或者也许你们其中一个人可以写点东西!

Thanks again for all help...

再次感谢所有帮助......

4 个解决方案

#1


7  

First, the definitions: a Solr/Lucene document is roughly the equivalent of a database row. An index is roughly the same as a database table.

首先,定义:Solr / Lucene文档大致相当于数据库行。索引与数据库表大致相同。

I recommend trying to store all the classified-related information in Solr. Querying Solr and then the database is inefficient and very likely unnecessary.

我建议尝试将所有与分类相关的信息存储在Solr中。查询Solr然后数据库是低效的,很可能是不必要的。

Querying in a specific region would be something like q=cars+region:washington assuming you have a region field in Solr.

在特定区域查询将类似q = cars + region:washington假设您在Solr中有一个区域字段。

The Solr wiki has tons of good information and a pretty good basic tutorial. Of course this can always be improved, so if you find anything that isn't clear please let the Solr team know about it.

Solr wiki拥有大量优秀的信息和非常好的基础教程。当然这可以随时改进,所以如果你发现任何不清楚的地方,请让Solr团队了解它。

I can't comment on the PHP client since I don't use PHP.

因为我不使用PHP,所以无法对PHP客户端发表评论。

#2


0  

Solr is going to return it's results in a syntax easily parsible using SimpleXml. You could also use the SolPHP client library: http://wiki.apache.org/solr/SolPHP.

Solr将使用SimpleXml以易于解析的语法返回结果。您还可以使用SolPHP客户端库:http://wiki.apache.org/solr/SolPHP。

Solr is really quite efficient. I suggest putting as much data into your Solr index as necessary to retrieve everything in one hit from Solr. This could mean much less database traffic for you.

Solr非常有效率。我建议根据需要将尽可能多的数据放入Solr索引,以便从Solr中检索所有内容。这可能意味着您的数据库流量要少得多。

If you've installed the example Solr application (comes with Jetty), then you can develop Solr queries using the admin interface. The URI of the result is pretty much what you'd be constructing in PHP.

如果您已经安装了示例Solr应用程序(Jetty附带),那么您可以使用管理界面开发Solr查询。结果的URI几乎就是你在PHP中构建的。

The most difficult part when beginning with Solr is getting the solrconfig.xml and the schema.xml files correct. I suggest starting with a very basic config, and restart your web app each time you add a field. Starting off with the whole schema.xml can be confusing.

从Solr开始时最困难的部分是使solrconfig.xml和schema.xml文件正确。我建议从一个非常基本的配置开始,并在每次添加字段时重新启动您的Web应用程序。从整个schema.xml开始可能会令人困惑。

#3


0  

2- Should I use only one SOLR document, or multiple documents? Also, is document the same as a SOLR index?

2-我应该只使用一个SOLR文档还是多个文档?此外,文档是否与SOLR索引相同?

3- Would it be better to Only use SOLR and skip MySQL knowing that I have alot of columns in each table? Personally I am much better at using MySQL than SOLR.

3-仅使用SOLR并跳过MySQL知道我在每个表中有很多列会更好吗?就个人而言,我比使用SOLR更善于使用MySQL。

A document is "an instance" of solr index. Take into account that you can build only one solr index per solr Core. A core acts as an independent solr Server into the same solr insallation.

文档是solr索引的“实例”。考虑到每个solr Core只能构建一个solr索引。核心作为独立的solr Server充当相同的solr insallation。

http://wiki.apache.org/solr/CoreAdmin

Yo can build one index merging some table contents and some other indexes to perform second level searches...

Yo可以构建一个索引合并一些表内容和一些其他索引来执行二级搜索...

would you give more details about your architecture and data??

你会提供有关你的架构和数据的更多细节吗?

#4


0  

As suggested by others you can store and index your mysql data and can run query in solr index, thus making mysql unnecessary to use. You don't need to just store and index ids and query and get ids and then run mysql query to get additional data against that id. You can just store other data corresponding to ids in solr itself.

正如其他人所建议的那样,你可以存储和索引你的mysql数据,并可以在solr索引中运行查询,从而使得mysql不必使用。您不需要只存储和索引ID并查询和获取ID,然后运行mysql查询以获取针对该ID的其他数据。您可以在solr中存储与id相对应的其他数据。

Regarding solr PHP client, then you don't need to use and it is recommended to directly use REST like Solr Web API. You can use PHP function like file_get_contents("http://IP:port/solr/#/core/select?q=query&start=0&rows=100&wt=json") or use curl with PHP if you need to. Both ways are almost same and efficient. This will return data in json as wt=json. Then use PHP function json_decode($returned_data) to get that data in object.

关于so​​lr PHP客户端,那么你不需要使用,建议直接使用像Solr Web API这样的REST。您可以使用PHP函数,如file_get_contents(“http:// IP:port / solr /#/ core / select?q = query&start = 0&rows = 100&wt = json”),或者如果需要,可以使用curl和PHP。两种方式几乎相同且有效。这将返回json中的数据为wt = json。然后使用PHP函数json_decode($ returned_data)在对象中获取该数据。

If you need to ask anything just reply.

如果您需要回答任何问题。


推荐阅读
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 本文由编程笔记#小编为大家整理,主要介绍了logistic回归(线性和非线性)相关的知识,包括线性logistic回归的代码和数据集的分布情况。希望对你有一定的参考价值。 ... [详细]
  • 本文介绍了如何使用PHP向系统日历中添加事件的方法,通过使用PHP技术可以实现自动添加事件的功能,从而实现全局通知系统和迅速记录工具的自动化。同时还提到了系统exchange自带的日历具有同步感的特点,以及使用web技术实现自动添加事件的优势。 ... [详细]
  • 2018年人工智能大数据的爆发,学Java还是Python?
    本文介绍了2018年人工智能大数据的爆发以及学习Java和Python的相关知识。在人工智能和大数据时代,Java和Python这两门编程语言都很优秀且火爆。选择学习哪门语言要根据个人兴趣爱好来决定。Python是一门拥有简洁语法的高级编程语言,容易上手。其特色之一是强制使用空白符作为语句缩进,使得新手可以快速上手。目前,Python在人工智能领域有着广泛的应用。如果对Java、Python或大数据感兴趣,欢迎加入qq群458345782。 ... [详细]
  • 生成式对抗网络模型综述摘要生成式对抗网络模型(GAN)是基于深度学习的一种强大的生成模型,可以应用于计算机视觉、自然语言处理、半监督学习等重要领域。生成式对抗网络 ... [详细]
  • 本文分享了一个关于在C#中使用异步代码的问题,作者在控制台中运行时代码正常工作,但在Windows窗体中却无法正常工作。作者尝试搜索局域网上的主机,但在窗体中计数器没有减少。文章提供了相关的代码和解决思路。 ... [详细]
  • 推荐系统遇上深度学习(十七)详解推荐系统中的常用评测指标
    原创:石晓文小小挖掘机2018-06-18笔者是一个痴迷于挖掘数据中的价值的学习人,希望在平日的工作学习中,挖掘数据的价值, ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • 关键词:Golang, Cookie, 跟踪位置, net/http/cookiejar, package main, golang.org/x/net/publicsuffix, io/ioutil, log, net/http, net/http/cookiejar ... [详细]
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 也就是|小窗_卷积的特征提取与参数计算
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了卷积的特征提取与参数计算相关的知识,希望对你有一定的参考价值。Dense和Conv2D根本区别在于,Den ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
author-avatar
as2520_526
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有