|
Size: 1584
Comment: surround's default operator limitation is added
|
← Revision 5 as of 2012-05-13 08:56:01 ⇥
Size: 1714
Comment: Highlighting limitation is added
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 22: | Line 22: |
| Highlighting does not work with surround query parser. See the [[https://issues.apache.org/jira/browse/SOLR-3060|JIRA issue]] |
Contents
Overview
The Surround query parser plugin provides support within Solr for the Surround query language. See chapter 9 of Lucene In Action (2nd ed). The query parser enables the use of span queries within Solr.
See the JIRA issue
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.
The operators can be used either in prefix notation - e.g. 5n(dog cat) or infix notation - dog 5n cat.
Subqueries can be nested, using parentheses to construct more complex queries. The boolean operators AND, OR, NOT are recognized. As with the standard QueryParser, fields may contain the wildcard characters '*" and '?', and the '^' (caret) followed by a floating point number for boosting queries.
Limitations
Queries are not analyzed in any way, so to get good results, applications must be aware of how a text field is indexed. A lightweight analysis chain such as lowercasing using the LowerCaseFilterFactory followed by the EnglishMinimalStemFilterFactory to remove plurals is recommended.
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 JIRA issue