lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koji Sekiguchi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-2136) Function Queries: if() function
Date Mon, 13 Jun 2011 16:41:51 GMT

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

Koji Sekiguchi commented on SOLR-2136:
--------------------------------------

I've met a strange behavior. With empty index, start example solr. Then hit:

http://localhost:8983/solr/select/?q={!func}if(exists(f1_b),10,20)&debug=results

you got an empty xml as expected. Then hit the above URL again, you got the following exception:

{code}
SEVERE: java.lang.ClassCastException: org.apache.solr.search.ValueSourceParser$60$1 cannot
be cast to org.apache.solr.search.function.SingleFunction
	at org.apache.solr.search.function.SimpleBoolFunction.equals(SimpleBoolFunction.java:66)
	at org.apache.solr.search.function.IfFunction.equals(IfFunction.java:137)
	at org.apache.solr.search.function.FunctionQuery.equals(FunctionQuery.java:202)
	at org.apache.solr.search.QueryResultKey.equals(QueryResultKey.java:78)
	at java.util.HashMap.getEntry(HashMap.java:349)
	at java.util.LinkedHashMap.get(LinkedHashMap.java:280)
	at org.apache.solr.search.LRUCache.get(LRUCache.java:129)
	at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:991)
	at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:346)
	at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:441)
	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:239)
	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1308)
	at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:353)
	at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:248)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
{code}


> Function Queries: if() function
> -------------------------------
>
>                 Key: SOLR-2136
>                 URL: https://issues.apache.org/jira/browse/SOLR-2136
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.4.1
>            Reporter: Jan H√łydahl
>             Fix For: 4.0
>
>         Attachments: SOLR-2136.patch, SOLR-2136.patch
>
>
> Add an if() function which will enable conditional function queries.
> The function could be modeled after a spreadsheet if function (e.g: http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Calc:_IF_function)
> IF(test; value1; value2) where:
>     test is or refers to a logical value or expression that returns a logical value (TRUE
or FALSE).
>     value1 is the value that is returned by the function if test yields TRUE.
>     value2 is the value that is returned by the function if test yields FALSE.
> If value2 is omitted it is assumed to be FALSE; if value1 is also omitted it is assumed
to be TRUE.
> Example use:
> if(color=="red"; 100; if(color=="green"; 50; 25))
> This function will check the document field "color", and if it is "red" return 100, if
it is "green" return 50, else return 25.

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

       

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


Mime
View raw message