Search to bring back maps that have been modified in last week

Need to verify if this is the query to bring back maps that have been modified in last 7 days.

I have tried the following without any results and I know I have modified maps within the last 7 days.

Here are two different query statements I have tried passing into the performSearch method..

  • <ishquery><and><ishfield name="FISHLASTMODIFIEDON" level="lng" ishoperator="greaterthanorequal">18/10/2015</ishfield></and><ishobjectfilters><ishtypefilter>ISHMasterDoc</ishtypefilter></ishobjectfilters></ishquery

  • <ishquery><and><ishfield name="MODIFIED-ON" level="logical" ishoperator="greaterthanorequal">18/10/2015</ishfield></and><ishobjectfilters><ishtypefilter>ISHMasterDoc</ishtypefilter></ishobjectfilters></ishquery>

If I substiture ISHModule for ISHMasterDoc it does bring back topics.

Any suggestions?

Parents
  • Hi Patrick,

    I assume you are on 2013SP1/10.0.1. Can you verify (and potentially provide) the content of the "InfoShareWS" server log file?

    Without verifying all details, I think your <ishquery> is missing elements and probably returns an error to your code base. Have a look at https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-047CE63F-76C2-4A34-A33E-489DEE2BF51C where the example holds <ishsort>, <ishversionfilter>, <ishlanguagefilter>,...

    I would also advise to use DocumentObj25.Find instead of Search25.PerformSearch unless you have specific reasons of course, see lower.


    Some background...
    The field FISHLASTMODIFIEDON is typically tied to the language (lng) level and only gets an update if a blob (xml, image,...) was successfully uploaded. The field MODIFIED-ON is available on the logical, version and language (lng) level and gets an update for any successfull metadata or blob change.
    You lower query (MODIFIED-ON on logical level) will most likely not return results as you are querying changes on a level far away from the language (lng) level. So the simplest change can be to change level="logical" to level="lng".

    The Search25.PerformSearch API (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-E9347C85-40E3-453F-95D5-DFA560287CDD) relies on the full-text-index collection which is a slave repository to the database if you will. Our "Crawler" service continuously matches database updates to the full-text-index one.

    The DocumentObj25.Find API (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B879F67C-211B-4B23-9A00-CE8823915D96) will execute the query using SQL on the database giving you the most accurate response possible and removes the dependency on the full-text-index collection.
  • Looks like using the modified-on is better since it is updated when ever anything is changed at any level (Logical, Version, Language) and since I am more concerned about content changes, looks like the level should be language.

    Let me look at the find api.

    Thanks
  • Can I specify a > = some date? Reading the documentation for the find does not seem to allow that in the metadata xml.
  • Parameter "psXMLMetadataFilter" on DocumentObj25.Find API (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B879F67C-211B-4B23-9A00-CE8823915D96) incorrectly links to "Metadata". This should have actually linked to "MetadataFilter" (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B5576E0D-03E9-4224-ADBE-6C3B51AFF890).

    On the "MetadataFilter" page the schema lists the available @ishoperator options where I think you are looking for "greaterthanorequal" resulting in something like
    <ishfield name="MODIFIED-ON" level="lng" ishoperator="greaterthanorequal">18/10/2015</ishfield>
Reply
  • Parameter "psXMLMetadataFilter" on DocumentObj25.Find API (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B879F67C-211B-4B23-9A00-CE8823915D96) incorrectly links to "Metadata". This should have actually linked to "MetadataFilter" (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B5576E0D-03E9-4224-ADBE-6C3B51AFF890).

    On the "MetadataFilter" page the schema lists the available @ishoperator options where I think you are looking for "greaterthanorequal" resulting in something like
    <ishfield name="MODIFIED-ON" level="lng" ishoperator="greaterthanorequal">18/10/2015</ishfield>
Children
  • Finally got around to looking at this again with no luck.
    I am using the find as you suggested so I don't have to rely on the full-text index but the database.

    <ishfields>

    <ishfield name="FISHMODIFIEDON" level="lng" ishoperator="greaterthanorequal">04/10/2015</ishfield>

    </ishfields>

    I want to return all maps that have had their content modified since that date. (checked in with a change to the map)

    I get nothing.

    Please write me out the exact code to test. Thanks

  • Patrick, unless it is a custom field, "FISHMODIFIEDON" in your example doesn't exist. This in turn means you should have received an error in your code, or at least some server log lines (default C:\infoshare\Data\Logs\) which are also greatly appreciated to share.

    My earlier examples read MODIFIED-ON (any blob or metadata change) or FISHLASTMODIFIEDON (notice LAST in the field name which tracks the latest blob change). Since your environment is still on 2013SP1/10.0.1 you cannot make use of this. This field was added on 2014/11.0.0 (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-A0346C14-B568-46B0-85FC-61B480002480)

    So what I expect to work for you is DocumentObj25.Find API (https://docs.sdl.com/LiveContent/content/en-US/SDL%20LiveContent%20full%20documentation-v143/GUID-B879F67C-211B-4B23-9A00-CE8823915D96)
    * psIshTypeFilter = ISHMasterDoc
    * eISHStatusGroup = ISHNoStatusFilter
    * psXMLMetadataFilter = <ishfields><ishfield name="MODIFIED-ON" level="lng" ishoperator="greaterthanorequal">18/10/2015</ishfield></ishfields>
    * psXMLRequestedMetadata = <ishfields><ishfield name="MODIFIED-ON" level="lng" /></ishfields>
  • Adding to this old thread, saw it only now.

    I cannot say with absolute certainty, but have a strong suspicion that the date format is dependent on the locale of the server that hosts the CCMS. In my case I had to experiment a while to find out that it was yyyymmdd. As I recall (was a while ago) I never got any error messages when the format was wrong either, just got nothing at all.