[ 
https://issues.apache.org/jira/browse/SOLR-2444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011544#comment-13011544
 ] 

Ryan McKinley commented on SOLR-2444:
-------------------------------------

In SOLR-1566, we added this first draft at paramater parsing.  As is, we have a 
few things happening:

h3. Mapping Field Names

with fl=id,score we get:
{code:xml}
<doc>
    <str name="id">GB18030TEST</str>
    <float name="score">1.0</float></doc>
 <doc>
{code}

with &fl=xxx=id,score
we get:
{code:xml}
<doc>
  <float name="score">1.0</float>
  <str name="xxx">GB18030TEST</str>
</doc>
{code}
id has been mapped to xxx


h3. DocTransformers

Added support to select transformers in the fl param.  See 
http://wiki.apache.org/solr/DocTransformers for more info (or help fill it in!)

&fl=id,\_explain\_ will give:
{code:xml}
<doc>
    <str name="id">GB18030TEST</str>
    <str name="_explain_">1.0 = (MATCH) MatchAllDocsQuery, product of:
  1.0 = queryNorm

</str></doc>
{code}

h4. Passing argument to transformer

we can change the format with: &fl=id,\_explain:nl\_ 
{code:xml}
<doc>
    <str name="id">GB18030TEST</str>
    <lst name="_explain:nl_">

      <bool name="match">true</bool>
      <float name="value">1.0</float>
      <str name="description">MatchAllDocsQuery, product of:</str>
      <arr name="details">
        <lst>
          <bool name="match">true</bool>
          <float name="value">1.0</float>

          <str name="description">queryNorm</str>
        </lst>
      </arr>
    </lst></doc>
{code}

Similarly, we can use the \_values\_ transformer to add a constant value to the 
output

&fl=id,\_value:hello\_
{code:xml}
<doc>
   <doc>
    <str name="id">GB18030TEST</str>
    <str name="_value:hello_">hello</str></doc>
{code}

or specify a type:

&fl=id,\_value:int:10\_
{code:xml}
<doc>
  <doc>
    <str name="id">GB18030TEST</str>
    <int name="_value:int:10_">10</int></doc>
{code}

aliasing also works with transformers

&fl=id,ten=\_value:int:10\_
{code:xml}
<doc>
  <doc>
    <str name="id">GB18030TEST</str>
    <int name="ten">10</int></doc>
{code}


h3. Wildcard parsing

The parser excepts wildcards -- we are not doing anything with them yet

h3. Multiple fl parameters

&fl=id,score

is equivalent to:

&fl=id&id=score















> support wildcards in fl parameter, improve DocTransformer parsing
> -----------------------------------------------------------------
>
>                 Key: SOLR-2444
>                 URL: https://issues.apache.org/jira/browse/SOLR-2444
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Ryan McKinley
>         Attachments: SOLR-2444-fl-parsing.patch, SOLR-2444-fl-parsing.patch
>
>
> The ReturnFields parsing needs to be improved.  It should also support 
> wildcards

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to