lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Trivial Update of "DisMaxQParserPlugin" by Bill Bell
Date Sun, 06 Feb 2011 00:32:05 GMT
Dear Wiki user,

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

The "DisMaxQParserPlugin" page has been changed by Bill Bell.
http://wiki.apache.org/solr/DisMaxQParserPlugin?action=diff&rev1=3&rev2=4

--------------------------------------------------

  <<TableOfContents>>
  
  == Overview ==
- 
  This query parser supports an extremely simplified subset of the Lucene !QueryParser syntax.
 Quotes can be used to group phrases, and +/- can be used to denote mandatory and optional
clauses ... but all other Lucene query parser special characters are escaped to simplify the
user experience.  The handler takes responsibility for building a good query from the user's
input using !BooleanQueries containing !DisjunctionMaxQueries across fields and boosts you
specify.  It also lets you provide additional boosting queries, boosting functions, and filtering
queries to artificially affect the outcome of all searches.  These options can all be specified
as default parameters for the handler in your solrconfig.xml or overridden in the Solr query
URL.
  
  == Query Syntax ==
- 
  This is designed to be support raw input strings provided by users with no special escaping.
  '+' and '-' characters are treated as "mandatory" and "prohibited" modifiers for the subsequent
terms.  Text wrapped in balanced quote characters '"' are treated as phrases, any query containing
an odd number of quote characters is evaluated as if there were no quote characters at all.
 Wildcards  are not supported.
  
  == Query Structure ==
- 
  For each "word" in the query string, dismax builds a !DisjunctionMaxQuery object for that
word across all of the fields in the `qf` param (with the appropriate boost values and a tiebreaker
value set from the `tie` param).  These !DisjunctionMaxQuery objects are then put in a !BooleanQuery
with the minNumberShouldMatch option set according to the `mm` param.  If any other params
are specified, a larger !BooleanQuery is wrapped arround the first !BooleanQuery from the
`qf` options, and the other params (`bf`, `bq`, `pf`) are added as optional clauses.  The
only complex clause comes from from the `pf` param, which is a single !DisjuntionMaxQuery
containing the whole query 'phrase' against each of the `pf` fields.
  
  /!\ :TODO: /!\ Need more detail on the query structure generated based on input ... a picture
would be nice.
  
  == Parameters ==
- 
  The following parameters are supported, either as regular request params, or as local params
  
  /!\ :TODO: /!\ document which params are multivalue
@@ -43, +39 @@

  Full details on the variety of complex expressions supported are explained in detail [[http://lucene.apache.org/solr/api/org/apache/solr/util/doc-files/min-should-match.html|here]].
  
  The default value is 100% (all clauses must match)
+ 
+ In Solr 1.4 and prior, you should basically set mm=0 if you want the equivilent of q.op=OR,
and mm=100% if you want the
+ equivilent of q.op=AND.
  
  === pf (Phrase Fields) ===
  Once the list of matching documents has been identified using the "fq" and "qf" params,
the "pf" param can be used to "boost" the score of documents in cases where all of the terms
in the "q" param appear in close proximity.
@@ -77, +76 @@

  /!\ 1.4 best practice:  Solr 1.4 best practice is to avoid rord. For date boosting, use
recip(ms(NOW,mydatefield),3.16e-11,1,1) or similar. See [[FunctionQuery|show more recent documents
first]], specifically '''recip''', '''ms''' and '''Date Boosting''' sections.
  
  == Examples ==
- 
  /!\ :TODO: /!\ cleanup and expand examples
  
  Search across multiple fields, specifying (via boosts) how important each field is relative
each other
+ 
  {{{
  http://localhost:8983/solr/select/?q=video&defType=dismax&qf=features^20.0+text^0.3
  }}}
+ You can boost results that have a field that matches a specific value...
  
- You can boost results that have a field that matches a specific value...
  {{{
  http://localhost:8983/solr/select/?q=video&defType=dismax&qf=features^20.0+text^0.3&bq=cat:electronics^5.0
  }}}
+ Using the "mm" param, 1 and 2 word queries require that all of the optional clauses match,
but for queries with three or more clauses one missing clause is allowed...
  
- 
- Using the "mm" param, 1 and 2 word queries require that all of the optional clauses match,
but for queries with three or more clauses one missing clause is allowed...
  {{{
  http://localhost:8983/solr/select/?q=belkin+ipod&defType=dismax&mm=2
  http://localhost:8983/solr/select/?q=belkin+ipod+gibberish&defType=dismax&mm=2

Mime
View raw message