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

Ryan Ernst commented on SOLR-5707:
----------------------------------

{quote}
 ie: confusion people might have about whether a ComputedField is/can/should-be 
indexed="true" or stored="true"
{quote}
I was going to add checks to make sure nothing is set, but forgot.

{quote}
Basically I'm just trying to wrap my head around whether, from an abstraction 
standpoint, it really makes sense for Expressions to be available as a 
FieldType, and that we're not shoehorning them in.
{quote}

That is a fair question. So doing this through a valueSourceParser would just 
make them accessible through a custom function in function queries?  But 
expressions are not equal to function queries!  Expressions can use the score 
and manipulate it any way they want (see examples in lucene expressions tests). 
 But my understanding of function queries is they add to the score, replacing 
it?  With expressions, you could have 3 different expressions you sort on, some 
of which might use the score, and get all 4 values back, in order to evaluate 
and debug. I think expressions make sense outside of function queries.  So I 
see two possibilities:
# Implement expression integration similar to how function queries work, 
possibly by adding "lang" or "type" or something like that to the QP so that 
you could choose which language (in this case, the lang would be "js" for 
current expressions, but there could be more in the future)
# Use pseudo fields like I have in the current patch (I'm just saying that it 
is an option, not that I prefer it over the other)

The advantage of #1 is that we get dynamic (defined in a search request) for 
free, while with pseudo fields there is no clear path.  I am not a fan of using 
query parsers like this (these aren't actually queries!), but it works..

{quote}
{code}
<lst name="bindings">
    ...
  </lst>
{code}
{quote}

I think bindings are very much tied to the schema.  The default bindings should 
be mappings to the (numeric) fields available in the schema.

> Lucene Expressions in Solr
> --------------------------
>
>                 Key: SOLR-5707
>                 URL: https://issues.apache.org/jira/browse/SOLR-5707
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Ryan Ernst
>         Attachments: SOLR-5707.patch
>
>
> Expressions should be available for use in Solr.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to