You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Peter Wolanin (JIRA)" <ji...@apache.org> on 2010/10/16 20:12:24 UTC

[jira] Created: (SOLR-2168) Velocity facet output for facet missing

Velocity facet output for facet missing
---------------------------------------

                 Key: SOLR-2168
                 URL: https://issues.apache.org/jira/browse/SOLR-2168
             Project: Solr
          Issue Type: Bug
          Components: Response Writers
    Affects Versions: 3.1
            Reporter: Peter Wolanin
            Priority: Minor



If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:

$facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (SOLR-2168) Velocity facet output for facet missing

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921852#action_12921852 ] 

Peter Wolanin edited comment on SOLR-2168 at 10/17/10 10:25 AM:
----------------------------------------------------------------

Those all sound like good changes.

In terms of templating -I'd find something like erb, or PHP, or jsp much easier, and I imagine many more people are failiar with those.  So far, I feel like it's hard to understand in velocity how variables and control structures are distinguished from the output, and it's not clear that it's a real template in terms of the way e.g. white space is handled or not.  This is especially true in the case of macro output, where is seems like e.g. the carriage returns and spaces I'd naturally include in control structures to make them readable become part of the output.

The variable handling is also weird, that I need to use #set() for actual assignment?

In terms of readablilty, loo for example, at this bit:
{code}
<li><a href="#url_for_home#lens&fq=$esc.url(
{code}

the &fq= is output in the middle of a series of macro and function calls but nothing visually distinguishes them.  Can I define new functions instead of macros?  If a macro call could be written as #{url_for_home} it would provide more visual separation. 

I notice in the patch you have:
{code}
"-${field.name}:[* TO *]"
{code}

Looks like the function call can be written like this?
{code}
${esc.url("-${field.name}:[* TO *]")}
{code}


      was (Author: pwolanin):
    
Those all sound like good changes.

In terms of templating -I'd find something like erb, or PHP, or jsp much easier, and I imagine many more people are failiar with those.  So far, I feel like it's hard to understand in velocity how variables and control structures are distinguished from the output, and it's not clear that it's a real template in terms of the way e.g. white space is handled or not.  This is especially try in the case of macro output, where is seems like e.g. the carriae returns and spaces I'd naturally include in control structures to make them readable become part of the output.

The variable handling is also weird, that I need to use #set() for actual assignment?

In terms of readablilty, loo for example, at this bit:
{code}
<li><a href="#url_for_home#lens&fq=$esc.url(
{code}

the &fq= is output in the middle of a series of macro and function calls but nothing visually distinguishes them.  Can I define new functions instead of macros?  If a macro call could be written as #{url_for_home} it would provide more visual separation. 

I notice in the patch you have:
{code}
"-${field.name}:[* TO *]"
{code}

Looks like the function call can be written like this?
{code}
${esc.url("-${field.name}:[* TO *]")}
{code}

  
> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921831#action_12921831 ] 

Erik Hatcher commented on SOLR-2168:
------------------------------------

I've taken the patch idea and gave it a slight modification.  In my effort to learn git, I've committed it to my "facet_missing" branch here: http://github.com/erikhatcher/lucene-solr/commit/70197cca24129141081d83ea422515dc69287e73  (I've still got to figure out how to push this change to Solr's trunk through git)

I changed the code to so that the #set wasn't needed and also changed the label shown for missing facets to <No $field.name> to have angle brackets to avoid it looking like a regular value.  These changes ok with you?   (I also cleaned up the formatting of that file slightly)

Out of curiosity, what's annoying about Velocity syntax?  (for example, show me how it'd look in your template language of choice)

> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921856#action_12921856 ] 

Yonik Seeley commented on SOLR-2168:
------------------------------------

http://git.apache.org/
http://github.com/apache/lucene-solr

> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921855#action_12921855 ] 

Peter Wolanin commented on SOLR-2168:
-------------------------------------


If you want to start using git more widely for devlopement (assuming people still post the final patches as attachments here) you might want to set up a canonical mirror some place on github so that everyone uses the same initial tree.  We have this for Drupal: http://github.com/drupal/drupal and mirroring out of svn is probably even easier if someone has a server and can just run a script on cron every ~15 min.

> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921854#action_12921854 ] 

Yonik Seeley commented on SOLR-2168:
------------------------------------

bq. In my effort to learn git, I've committed it to my "facet_missing" branch here

Hmmm, I'm liking this already...
Nice and easy review of patches (including commenting), and you can get just the patch, or the compete file, or the complete tree.


> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (SOLR-2168) Velocity facet output for facet missing

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Wolanin updated SOLR-2168:
--------------------------------

    Attachment: SOLR-2168.patch

Attaching a function (if not elegant) fix - I find the velocity template syntax a little ... annoying

> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Issue Comment Edited: (SOLR-2168) Velocity facet output for facet missing

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921737#action_12921737 ] 

Peter Wolanin edited comment on SOLR-2168 at 10/16/10 3:11 PM:
---------------------------------------------------------------

Attaching a functional (if not elegant) fix - I find the velocity template syntax a little ... annoying

      was (Author: pwolanin):
    Attaching a function (if not elegant) fix - I find the velocity template syntax a little ... annoying
  
> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921833#action_12921833 ] 

Erik Hatcher commented on SOLR-2168:
------------------------------------

Also, in the patch I linked to in my previous comment I made it so that the missing facet isn't shown if the count is zero.

> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (SOLR-2168) Velocity facet output for facet missing

Posted by "Peter Wolanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921852#action_12921852 ] 

Peter Wolanin commented on SOLR-2168:
-------------------------------------


Those all sound like good changes.

In terms of templating -I'd find something like erb, or PHP, or jsp much easier, and I imagine many more people are failiar with those.  So far, I feel like it's hard to understand in velocity how variables and control structures are distinguished from the output, and it's not clear that it's a real template in terms of the way e.g. white space is handled or not.  This is especially try in the case of macro output, where is seems like e.g. the carriae returns and spaces I'd naturally include in control structures to make them readable become part of the output.

The variable handling is also weird, that I need to use #set() for actual assignment?

In terms of readablilty, loo for example, at this bit:
{code}
<li><a href="#url_for_home#lens&fq=$esc.url(
{code}

the &fq= is output in the middle of a series of macro and function calls but nothing visually distinguishes them.  Can I define new functions instead of macros?  If a macro call could be written as #{url_for_home} it would provide more visual separation. 

I notice in the patch you have:
{code}
"-${field.name}:[* TO *]"
{code}

Looks like the function call can be written like this?
{code}
${esc.url("-${field.name}:[* TO *]")}
{code}


> Velocity facet output for facet missing
> ---------------------------------------
>
>                 Key: SOLR-2168
>                 URL: https://issues.apache.org/jira/browse/SOLR-2168
>             Project: Solr
>          Issue Type: Bug
>          Components: Response Writers
>    Affects Versions: 3.1
>            Reporter: Peter Wolanin
>            Priority: Minor
>         Attachments: SOLR-2168.patch
>
>
> If I add fact.missing to the facet params for a field, the Veolcity output has in the facet list:
> $facet.name (9220)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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