You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Andy Bowes <an...@scientiasolutions.com> on 2004/09/23 16:54:27 UTC

Error creating SearchQuery

Hi Guys,

I am getting the following exception thrown when I attempt to create a
SearchQuery:

org.apache.slide.search.InvalidQueryException: Expected exactly 1 prop
element, found 2
	at
org.apache.slide.search.basic.expression.ComparedProperty.setProperty(Compar
edProperty.java:169)
	at
org.apache.slide.search.basic.expression.ComparedProperty.<init>(ComparedPro
perty.java:123)
	at
org.apache.slide.search.basic.expression.ComparePropertyExpression.<init>(Co
mparePropertyExpression.java:65)
	at
org.apache.slide.search.basic.expression.EQExpression.<init>(EQExpression.ja
va:47)
	at
org.apache.slide.search.basic.BasicExpressionFactory.createDAVExpression(Bas
icExpressionFactory.java:241)
	at
org.apache.slide.search.basic.BasicExpressionFactory.createExpression(BasicE
xpressionFactory.java:193)
	at
org.apache.slide.search.basic.BasicExpressionCompiler.createExpression(Basic
ExpressionCompiler.java:177)
	at
org.apache.slide.search.basic.BasicExpressionCompiler.compile(BasicExpressio
nCompiler.java:130)
	at
org.apache.slide.search.basic.BasicQueryImpl.parseQuery(BasicQueryImpl.java:
206)


The Query XML looks like:

<basicsearch xmlns="DAV:">
  <select>
    <prop>
      <getname />
    </prop>
  </select>
  <from>
    <scope>
      <href>/</href>
    </scope>
  </from>
  <where>
    <eq>
      <prop>
        <uuid />
        <literal>0cb53c48fef5cdd72acc65ff2b9c9d318000</literal>
      </prop>
    </eq>
  </where>
</basicsearch>

It looks like I have a problem with the <eq> statement in the <where> clause
but I haven't got a clue as to what this statement shoudl look like as I
cannot find any examples or documentation.  Can anyone help ?

Thanks

Andy Bowes


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Error creating SearchQuery

Posted by Julian Reschke <ju...@gmx.de>.
Andy Bowes wrote:
> Hi Guys,
> 
> I am getting the following exception thrown when I attempt to create a
> SearchQuery:
> 
> org.apache.slide.search.InvalidQueryException: Expected exactly 1 prop
> element, found 2
> 	at
> org.apache.slide.search.basic.expression.ComparedProperty.setProperty(Compar
> edProperty.java:169)
> 	at
> org.apache.slide.search.basic.expression.ComparedProperty.<init>(ComparedPro
> perty.java:123)
> 	at
> org.apache.slide.search.basic.expression.ComparePropertyExpression.<init>(Co
> mparePropertyExpression.java:65)
> 	at
> org.apache.slide.search.basic.expression.EQExpression.<init>(EQExpression.ja
> va:47)
> 	at
> org.apache.slide.search.basic.BasicExpressionFactory.createDAVExpression(Bas
> icExpressionFactory.java:241)
> 	at
> org.apache.slide.search.basic.BasicExpressionFactory.createExpression(BasicE
> xpressionFactory.java:193)
> 	at
> org.apache.slide.search.basic.BasicExpressionCompiler.createExpression(Basic
> ExpressionCompiler.java:177)
> 	at
> org.apache.slide.search.basic.BasicExpressionCompiler.compile(BasicExpressio
> nCompiler.java:130)
> 	at
> org.apache.slide.search.basic.BasicQueryImpl.parseQuery(BasicQueryImpl.java:
> 206)
> 
> 
> The Query XML looks like:
> 
> <basicsearch xmlns="DAV:">
>   <select>
>     <prop>
>       <getname />
>     </prop>
>   </select>
>   <from>
>     <scope>
>       <href>/</href>
>     </scope>
>   </from>
>   <where>
>     <eq>
>       <prop>
>         <uuid />
>         <literal>0cb53c48fef5cdd72acc65ff2b9c9d318000</literal>
>       </prop>
>     </eq>
>   </where>
> </basicsearch>
> 
> It looks like I have a problem with the <eq> statement in the <where> clause
> but I haven't got a clue as to what this statement shoudl look like as I
> cannot find any examples or documentation.  Can anyone help ?

The spec is in 
<http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-latest.html>. 
What you need is:

   <where>
     <eq>
       <prop>
         <uuid />
       </prop>
       <literal>0cb53c48fef5cdd72acc65ff2b9c9d318000</literal>
     </eq>
   </where>

instead.

Best regards, Julian


-- 
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org