简体   繁体   English

使用SphinxSE的MariaDB 10.0

[英]MariaDB 10.0 with SphinxSE

I have a question about integrating Sphinx with MariaDB 10.0. 我有一个关于将Sphinx与MariaDB 10.0集成的问题。 The db comes packaged with the SphinxSE storage engine, but I'm having trouble finding detailed information about how to set this up. 该数据库附带了SphinxSE存储引擎,但是我在查找有关如何设置它的详细信息时遇到了麻烦。 Consider the following scenario: 请考虑以下情形:

I have a book-selling app using a database with the following tables: "Book", "Listing", and "School". 我有一个图书销售应用程序,该应用程序使用具有以下表格的数据库:“图书”,“清单”和“学校”。 A "listing" contains a relationship to a single book and a single school. “清单”包含与一本书和一所学校的关系。 A "book" contains several columns, most importantly "title" and "author". 一本“书”包含几列,最重要的是“书名”和“作者”。 I would like to perform full-text searches on the "Book" table using Sphinx, and a typical query might go something like this (in pseudo-SQL): "Find all books whose title contains the string 'Harry P' for which a current listing exists at Harvard University". 我想使用Sphinx在“ Book”表上执行全文搜索,典型的查询可能是这样的(在伪SQL中):“查找标题包含字符串“ Harry P”的所有书籍,哈佛大学当前列表”。

According to MariaDB's article : "you need to create a special ENGINE=SPHINX 'search table', and then SELECT from it with full text query..." - so does this mean that Sphinx cannot access/index my existing MariaDB tables at all? 根据MariaDB的文章 :“您需要创建一个特殊的ENGINE = SPHINX'搜索表',然后使用全文查询从中进行选择...”-这是否意味着Sphinx根本无法访问/索引我现有的MariaDB表? Must I recreate my "Book" table as a SphinxSE table? 我必须将“ Book”表重新创建为SphinxSE表吗? If this is the case, how do I specify relationships between this table and my other non-Sphinx tables (Listing, School, etc)? 在这种情况下,如何指定此表与其他非Sphinx表(列表,学校等)之间的关系? The above article gives a very simple JOIN example, but I'm still confused. 上面的文章给出了一个非常简单的JOIN示例,但我仍然感到困惑。 If all "books" are stored in a Sphinx table, can MariaDB access this table for different types of queries (where a full-text search is not needed)? 如果所有“书”都存储在Sphinx表中,MariaDB是否可以访问该表以进行不同类型的查询(不需要全文搜索)?

As a related question, what would be a good way to enable Sphinx to index both the Title and the Author of the books? 作为一个相关的问题,怎样使Sphinx能够同时索引书名和书名? The app will always specify which field is being queried. 该应用程序将始终指定要查询的字段。

Any help would be greatly appreciated, because hours of searching and reading has still left me mostly in the dark on this topic. 任何帮助将不胜感激,因为数小时的搜索和阅读仍然使我对这个话题几乎一无所知。

The SphinxSE engine is NOT a real engine. SphinxSE引擎不是真正的引擎。 All it does is serve a 'proxy' to a underlying Sphinx daemon. 它所做的只是为基础Sphinx守护程序提供“代理”。 It runs the query against sphinx engine, then presents the 'results' as a FAKE table, so that mysql can then join it back with the original table(s). 它对狮身人面像引擎运行查询,然后将“结果”显示为FAKE表,以便mysql然后可以将其与原始表联接起来。

Basically a convenience method to get sphinx results and the apprirate data in one query (with mysql doing the hard work of doing the 'JOIN') 基本上,这是一种方便的方法,可在一个查询中获取sphinx结果和适当的数据(使用mysql进行“ JOIN”的艰苦工作)

... so before "worrying" about sphinxSE. ...所以在“担心” sphinxSE之前。 You need to figure out a normal Sphinx index, that you can run queries against. 您需要找出一个普通的Sphinx索引,可以对其运行查询。 ie create an index to be able to run that query. 即创建一个索引以能够运行该查询。 Normally the sphinx query will just give you a list of ids. 通常情况下,狮身人面像查询只会为您提供ID列表。

So play with getting sphinx setup independantly (without SphinxSE or MariaDB) - create an index, and run some queries against it. 因此,您可以独立获取sphinx设置(无需SphinxSE或MariaDB)-创建一个索引,并对它运行一些查询。 Get that working first. 首先开始工作。

Only once you have the index working (and you understand the concepts) - come back and work out how to set it up with SphinxSE. 只有你有指标工作(和你理解的概念) -回来,并制定出如何使用与SphinxSE设置。

There are plenty of articles on getting sphinx working https://www.google.com/search?q=sphinx+search+getting+started 有关使狮身人面像正常工作的大量文章, https://www.google.com/search? q = sphinx + search + getting + started

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

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