0

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?

Community
  • 1
  • 1
Max
  • 130
  • 3
  • 10

1 Answers1

0
  • 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
Community
  • 1
  • 1
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
  • Sure (unfortunately I cannot vote for your answer yet). I've checked [JIRA issue](https://issues.apache.org/jira/browse/SOLR-1337) associated with "strict order operator" feature and it is still open. Though it's possible to implement it myself (at least theoretically), Sphinx has an advantage in terms of this specific feature because it provides a working solution. – Max Aug 07 '12 at 11:03
  • of course, Solr is not necessarily the best tool for everybody, maybe Sphinx works best for you... – Persimmonium Aug 07 '12 at 11:19