elasticsearch,mathjax,mathml,Laravel,elasticsearch,Mathjax,Mathml" /> elasticsearch,mathjax,mathml,Laravel,elasticsearch,Mathjax,Mathml" />

Laravel 如何在MathML中使用elasticsearch索引公式?

Laravel 如何在MathML中使用elasticsearch索引公式?,laravel,elasticsearch,mathjax,mathml,Laravel,elasticsearch,Mathjax,Mathml,我有一个问答网站,它使用Elasticsearch,也使用MathML键入公式。比如说 <math xmlns="http://www.w3.org/1998/Math/MathML"> <mi>d</mi> <mi>e</mi> <mi>t</mi> <mo> </mo> <mi>A</mi> &

我有一个问答网站,它使用Elasticsearch,也使用MathML键入公式。比如说

<math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>d</mi>
    <mi>e</mi>
    <mi>t</mi>
    <mo> </mo>
    <mi>A</mi>
    <mo>≠</mo>
    <mn>0</mn>
</math>

D
E
T
A.
≠
0
det A的MathML代码吗≠ 0


问题是elasticsearch像索引一个简单的文本(而不是公式)一样对其进行索引,因此搜索“det”的结果是无效的。

您的MathML在语义上不适合您所做的事情。这并不意味着
deta≠ 0
,而是
d*e*t A≠ 0
;这是
d
e
t
的乘积,后面紧跟着
A≠ 0
(我不确定空的
代表什么,但MathML忽略了空格。)

更好的代表性是


详细资料
⁡;
A.
≠
0

这也可以解决您的搜索问题,因为现在
det
将匹配某些内容。

谢谢,它非常有用。