Hi Adam,

Adam Steidley wrote:
So I am trying to replicate the same query that the search text box in the
CMS interface is using.  I would assume that the below DASL would be
equivalent:

<DAV:searchrequest xmlns:DAV="DAV:"
xmlns:slide="http://jakarta.apache.org/slide/";
xmlns:h="http://hippo.nl/cms/1.0";><DAV:basicsearch>

<DAV:select><DAV:prop>

      <DAV:displayname/>

<h:caption/> <h:type/>
</DAV:prop></DAV:select>

<DAV:from>

      <DAV:scope>

            <DAV:href></DAV:href>

            <DAV:depth>infinity</DAV:depth>

      </DAV:scope>

</DAV:from>

<DAV:where>

      <DAV:contains>e</DAV:contains>

</DAV:where>

</DAV:basicsearch></DAV:searchrequest>

I'm finding that the above returns VERY different results than the simple
search.  Namely only about 5% of the correct records. Am I missing something
in the syntax?

You can easily check the DASL that is used for a search from the CMS using a tool like tcpmon [1]. I did a quick test and got the following query:

<?xml version="1.0" encoding="utf-8"?>
<dav:searchrequest xmlns="http://hippo.nl/webdav/1.0"; xmlns:i18n="http://apache.org/cocoon/i18n/2.1"; xmlns:s="http://jakarta.apache.org/slide/"; xmlns:cms="http://hippo.nl/cms/1.0"; xmlns:dav="DAV:"
  xmlns:webdav="http://hippo.nl/webdav/1.0";>
  <dav:basicsearch>
    <dav:select>
      <dav:prop>
        <s:nrHits/>
        <cms:publicationDate/>
        <cms:unpublicationDate/>
        <cms:requestedPublicationDate/>
        <cms:scheduledPublicationDate/>
        <cms:latestUnpublicationDate/>
        <cms:workflowId/>
        <cms:lastWorkflowUser/>
        <cms:type/>
        <cms:lastSaved/>
        <cms:deletionRequested/>
        <dav:lockdiscovery/>
        <modificationdate xmlns="DAV:"/>
        <caption xmlns="http://hippo.nl/cms/1.0"/>
        <type xmlns="http://hippo.nl/cms/1.0"/>
        <createdBy xmlns="http://hippo.nl/cms/1.0"/>
        <lastModifiedBy xmlns="http://hippo.nl/cms/1.0"/>
      </dav:prop>
    </dav:select>
    <dav:from>

      <dav:scope>
        <dav:href>/default/files/default.preview</dav:href>
        <dav:depth>Infinity</dav:depth>
      </dav:scope>

    </dav:from>
    <dav:where>
      <dav:and>
        <dav:is-defined>
          <dav:prop>
            <cms:type/>
          </dav:prop>
        </dav:is-defined>
        <dav:or>
          <dav:contains>test</dav:contains>
          <s:propcontains>
            <dav:prop>
              <cms:caption/>
            </dav:prop>
            <dav:literal>test</dav:literal>
          </s:propcontains>
        </dav:or>
      </dav:and>
    </dav:where>
    <dav:orderby>


      <dav:order xmlns="">
        <dav:prop>
          <modificationdate xmlns="DAV:"/>
        </dav:prop>
        <dav:descending/>
      </dav:order>


    </dav:orderby>
    <dav:limit>
      <dav:nresults>20</dav:nresults>
      <s:offset>0</s:offset>
    </dav:limit>
  </dav:basicsearch>
</dav:searchrequest>

The main difference with your query seems to be the propcontains, so it also returns documents for which the caption property matches the search query.

[1] https://tcpmon.dev.java.net/


Regards

Niels




********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to