Does Solr have an equivalent of “strict order operator” that Sphinx has?

别来无恙 提交于 2019-12-25 01:16:25

问题


I'm choosing between Solr and Sphinx.

Sphinx doc page has a section called "5.3. Extended query syntax" which describes the following search parameters (among others) :

  • strict order operator (example: aaa << bbb << ccc) -
  • NEAR, generalized proximity operator (example: hello NEAR/3 world NEAR/4 "my test") - search according to distance between words
  • SENTENCE/PARAGRAPH (example: "Bill Gates" PARAGRAPH "Steve Jobs") - search inside a sentence/paragraph

Does Solr have any similar functionality?


回答1:


  • strict order operator: you would need to use SpanQueries for this, look at enter link description here for an explanation of SpanQuery, and in order to use them from Solr, you could try SurroundQParser or else see this other question
  • NEAR, generalized proximity operator: yes, this is supported, see Proximity search
  • SENTENCE/PARAGRAPH: not directly. You could try several approaches:
    • Map somehow those to documents (and maybe use Join functionality in 4.0 to link Paragraph documents to parent documents etc)
    • Try to insert information about paragraphs with special tokens/gaps, see this


来源:https://stackoverflow.com/questions/11797183/does-solr-have-an-equivalent-of-strict-order-operator-that-sphinx-has

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!