lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher (JIRA)" <>
Subject [jira] [Commented] (SOLR-839) XML Query Parser support
Date Mon, 25 Feb 2013 14:52:18 GMT


Erik Hatcher commented on SOLR-839:

With the latest patch, these queries work (borrowed from SOLR-4351's tests):

  <term f="id">11</term>

  <field f="text">Now Cow</field>

  <prefix f="text">brow</prefix>

  <frange l="20" u="24">mul(foo_i,2)</frange>

  <join from="qqq_s" to="www_s">id:10</join>

  <join from="qqq_s" to="www_s"><term f="id">10</term></join>

  <lucene>text:Cow -id:1</lucene>

The "object parser" path worked easily, but it's not as powerful as it needs to be.  There
needs to be a way to make BooleanQuery's (without having to use the lucene query parser) and
then, like the XMLQueryParser, do stuff with span queries and so on.

Maybe it's not worthwhile to have both JSON and XML query parsing as they both should probably
use the same infrastructure.  But I would hate to see a JSON form of XSLT used here.  Ideally,
the query "tree" would be defined server-side and lean/clean parameters would be passed in
to fill in the blanks, but also possibly having some logic based on the values of the parameters
(&in_stock=true, would if specified add a filter for inStock:true, for example)

The XMLQParser in the last patch has xsl capability as well, so that you could define id.xsl
to be:

<xsl:stylesheet version="1.0" xmlns:xsl="">
  <xsl:template match="/Document">
    <term f="id"><xsl:value-of select="id"/></term>

Then using &defType=xml&xsl=id&id=SOLR1000 a term query will be generated.  (this
is too simple of an example, as there would be other leaner/cleaner ways to do this exact

> XML Query Parser support
> ------------------------
>                 Key: SOLR-839
>                 URL:
>             Project: Solr
>          Issue Type: New Feature
>          Components: query parsers
>    Affects Versions: 1.3
>            Reporter: Erik Hatcher
>            Assignee: Erik Hatcher
>             Fix For: 5.0
>         Attachments: lucene-xml-query-parser-2.4-dev.jar, SOLR-839-object-parser.patch,
> Lucene contrib includes a query parser that is able to create the full-spectrum of Lucene
queries, using an XML data structure.
> This patch adds "xml" query parser support to Solr.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message