You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2013/07/03 16:08:43 UTC

[Solr Wiki] Update of "SurroundQueryParser" by ErikHatcher

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SurroundQueryParser" page has been changed by ErikHatcher:
https://wiki.apache.org/solr/SurroundQueryParser?action=diff&rev1=5&rev2=6

  <<TableOfContents>>
  
  == Overview ==
- The Surround query parser plugin  provides support within Solr for the Surround query language. See chapter 9 of [[http://manning.com/lucene/|Lucene In Action (2nd ed)]]. The query parser enables the use of span queries within  Solr.
+ The Surround query parser plugin  provides support within Solr for the Surround query language. 
  
- See the  [[https://issues.apache.org/jira/browse/SOLR-2703|JIRA issue]]
+ From [[https://lucene.apache.org/core/4_3_1/queryparser/org/apache/lucene/queryparser/surround/parser/QueryParser.html|surround QueryParser javadocs]]:
+ 
+ {{{
+ This parser generates queries that make use of position information (Span queries). It provides positional operators (w and n) that accept a numeric distance, as well as boolean operators (and, or, and not, wildcards (* and ?), quoting (with "), and boosting (via ^).
+ 
+ The operators (W, N, AND, OR, NOT) can be expressed lower-cased or upper-cased, and the non-unary operators (everything but NOT) support both infix (a AND b AND c) and prefix AND(a, b, c) notation.
+ 
+ The W and N operators express a positional relationship among their operands. N is ordered, and W is unordered. The distance is 1 by default, meaning the operands are adjacent, or may be provided as a prefix from 2-99. So, for example, 3W(a, b) means that terms a and b must appear within three positions of each other, or in other words, up to two terms may appear between a and b. 
+ }}}
+ 
+ 
+ See also chapter 9 of [[http://manning.com/lucene/|Lucene In Action (2nd ed)]]. The query parser enables the use of span queries within Solr.
+ 
+ This was added[[https://issues.apache.org/jira/browse/SOLR-2703|SOLR-2703]]
  
  == Query Syntax ==
  Surround defines two operators. '''n''' creates an unordered SpanNearQuery and '''w''' creates an ordered one. Each of these can be prepended by an integer in the range 2-99, which indicates the maximum acceptable span distance. Without the integer, the distance defaults to 1.
@@ -21, +34 @@

  
  There is no room for default operator in surround query parser. For example, the query '''dog cat''' throws ParseException.
  
- Highlighting does not work with surround query parser. See the [[https://issues.apache.org/jira/browse/SOLR-3060|JIRA issue]] 
+ Highlighting support for the surround query parser was fixed in [[Solr4.2]] (see the [[https://issues.apache.org/jira/browse/SOLR-3060|SOLR-3060]])
  
- == Examples ==
-