Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF75361F4 for ; Mon, 13 Jun 2011 16:42:17 +0000 (UTC) Received: (qmail 44493 invoked by uid 500); 13 Jun 2011 16:42:16 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 44417 invoked by uid 500); 13 Jun 2011 16:42:16 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 44410 invoked by uid 99); 13 Jun 2011 16:42:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 16:42:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 16:42:13 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E0404417B44 for ; Mon, 13 Jun 2011 16:41:51 +0000 (UTC) Date: Mon, 13 Jun 2011 16:41:51 +0000 (UTC) From: "Koji Sekiguchi (JIRA)" To: dev@lucene.apache.org Message-ID: <871070844.3025.1307983311914.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (SOLR-2136) Function Queries: if() function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-2136?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13048= 642#comment-13048642 ]=20 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=3D{!func}if(exists(f1_b),10,20)&debug= =3Dresults 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.ValueSourcePar= ser$60$1 cannot be cast to org.apache.solr.search.function.SingleFunction =09at org.apache.solr.search.function.SimpleBoolFunction.equals(SimpleBoolF= unction.java:66) =09at org.apache.solr.search.function.IfFunction.equals(IfFunction.java:137= ) =09at org.apache.solr.search.function.FunctionQuery.equals(FunctionQuery.ja= va:202) =09at org.apache.solr.search.QueryResultKey.equals(QueryResultKey.java:78) =09at java.util.HashMap.getEntry(HashMap.java:349) =09at java.util.LinkedHashMap.get(LinkedHashMap.java:280) =09at org.apache.solr.search.LRUCache.get(LRUCache.java:129) =09at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearche= r.java:991) =09at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.jav= a:346) =09at org.apache.solr.handler.component.QueryComponent.process(QueryCompone= nt.java:441) =09at org.apache.solr.handler.component.SearchHandler.handleRequestBody(Sea= rchHandler.java:239) =09at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandl= erBase.java:129) =09at org.apache.solr.core.SolrCore.execute(SolrCore.java:1308) =09at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter= .java:353) =09at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilte= r.java:248) =09at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servlet= Handler.java:1212) =09at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3= 99) =09at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav= a:216) =09at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1= 82) =09at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7= 66) =09at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) =09at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand= lerCollection.java:230) =09at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.= java:114) =09at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1= 52) =09at org.mortbay.jetty.Server.handle(Server.java:326) =09at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:54= 2) =09at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo= nnection.java:928) =09at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) =09at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) =09at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) =09at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.= java:228) =09at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j= ava: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=C3=B8ydahl > 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 log= ical value (TRUE or FALSE). > value1 is the value that is returned by the function if test yields T= RUE. > value2 is the value that is returned by the function if test yields F= ALSE. > 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=3D=3D"red"; 100; if(color=3D=3D"green"; 50; 25)) > This function will check the document field "color", and if it is "red" r= eturn 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