简体   繁体   English

关于SOLR及其实际工作方式的一些疑问!

[英]Some Q regarding SOLR and how it actually works!

I have a classifieds website, and I have currently around 100thousand ads in a mysql table. 我有一个分类广告网站,目前在mysql表中有大约10万个广告。

I am using php to fetch results and to display them on a page. 我正在使用php来获取结果并将其显示在页面上。 However, I am noticing the searches getting slower and slower. 但是,我注意到搜索越来越慢。 That is why I am planning on installing and using SOLR, as I have heard good things about it. 这就是为什么我计划安装和使用SOLR的原因,因为我听说过有关它的一些好消息。

But to my suprise, I haven't found much information on how it works exactly... Please answer these Q about SOLR and provide me with the most information you can about how it works: 但是令我惊讶的是,我还没有找到有关其工作原理的详细信息。请回答有关SOLR的问题,并向我提供有关其工作原理的最多信息:

1- Is SOLR the same as a mysql table, only faster? 1- SOLR是否与mysql表相同,只是速度更快?

2- On a site which uses mysql to show ads, insert ads, search ads etc, would all the mysql need to be 'bypassed' to some SOLR function which is similiar as the mysql function? 2-在使用mysql展示广告,插入广告,搜索广告等的网站上,是否需要将所有mysql“绕过”某些类似于mysql函数的SOLR函数? To clarify, here is an example: If I use "SELECT * FROM table WHERE id=$id" as a query-string to query the table, would I then have to use some other function which is similiar to this, but for SOLR? 为了阐明这一点,下面是一个示例:如果我使用"SELECT * FROM table WHERE id=$id"作为查询字符串来查询表,那么我是否必须使用其他与此类似的函数,但是对于SOLR ?

3- When users 'insert ads' they are inserted into the mysql table, is there a function for this as well, but for SOLR? 3-当用户“插入广告”将其插入到mysql表中时,是否也有此功能,但是有SOLR功能吗?

4- How are the search-parameters or search-criteria passed to SOLR? 4-如何将搜索参数或搜索条件传递给SOLR?

Thanks 谢谢

Lucene is a fulltext indexing service and a search engine. Lucene是全文索引服务和搜索引擎。 SOLR is a service built upon Lucene, which allows you to access it, for example from PHP. SOLR是基于Lucene构建的服务,它使您可以从PHP中访问它。 SOLR is implemented in Java, and it offers a web-service interface for integration from PHP. SOLR用Java实现,它提供了一个Web服务接口,用于从PHP进行集成。 Alternatively you can use a native PHP-implementation of the search engine, however the Java implementation (which SOLR uses) is much faster and feature-rich. 另外,您可以使用搜索引擎的本机PHP实现 ,但是Java实现(SOLR使用)更加快捷且功能丰富。

You generally use Lucene/SOLR as a supplement to a relation database (Such as MySql). 通常,您可以使用Lucene / SOLR作为关系数据库的补充(例如MySql)。 The typical use case is that you issue a query to the Lucene index, which returns an ID. 典型的用例是您向Lucene索引发出查询,该查询返回ID。 This ID can then be used to find the related entry in your database. 然后可以使用此ID在数据库中查找相关条目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM