<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Search for the node just created JAVA in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/search-for-the-node-just-created-java/m-p/19281#M8525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using Alfresco 5.0 or above, there is no more Lucene. If you mean you are using the "search query language" Lucene, then you should stop doing that - it is a legacy language. Use Alfresco FTS or CMIS queries instead. These query languages are also capable of using a direct DB query if the query is simple enough (look for transactional metadata query in the documentation). In that case there is no delay for indexing at all. If your query is too complex to execute against the DB, you will always have to deal with the asynchronous indexing that SOLR performs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I don't really know what other conditions you want to query for ("just created" is a bit too vague) it is difficult to suggest an alternative to looking up nodes via the NodeService. If you don't care about the type and/or other metadata on the document(s), and really want to look up "any" document "just created", you can do a simple CMIS query like:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SELECT * from cmis:document D where D.cmis:creationDate &amp;gt; TIMESTAMP '2017-03-23T19:30:00.000Z'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above query selects all documents that have been created after the specified timestamp. Obviously you would have to dynamically create the query to adjust the timestamp to the meaning of "just created" you need to handle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Mar 2017 19:31:14 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2017-03-23T19:31:14Z</dc:date>
    <item>
      <title>Search for the node just created JAVA</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-for-the-node-just-created-java/m-p/19280#M8524</link>
      <description>Hi All,In one requirement I need to query just created document. If I use lucene search then it will take few seconds to do the indexing and may not come in the search result.The query should be executing from some alfresco webscript or a scheduler which runs every 5 seconds.Right now I am doing it</description>
      <pubDate>Fri, 17 Mar 2017 14:25:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-for-the-node-just-created-java/m-p/19280#M8524</guid>
      <dc:creator>alfresco_one</dc:creator>
      <dc:date>2017-03-17T14:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search for the node just created JAVA</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/search-for-the-node-just-created-java/m-p/19281#M8525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using Alfresco 5.0 or above, there is no more Lucene. If you mean you are using the "search query language" Lucene, then you should stop doing that - it is a legacy language. Use Alfresco FTS or CMIS queries instead. These query languages are also capable of using a direct DB query if the query is simple enough (look for transactional metadata query in the documentation). In that case there is no delay for indexing at all. If your query is too complex to execute against the DB, you will always have to deal with the asynchronous indexing that SOLR performs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I don't really know what other conditions you want to query for ("just created" is a bit too vague) it is difficult to suggest an alternative to looking up nodes via the NodeService. If you don't care about the type and/or other metadata on the document(s), and really want to look up "any" document "just created", you can do a simple CMIS query like:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SELECT * from cmis:document D where D.cmis:creationDate &amp;gt; TIMESTAMP '2017-03-23T19:30:00.000Z'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above query selects all documents that have been created after the specified timestamp. Obviously you would have to dynamically create the query to adjust the timestamp to the meaning of "just created" you need to handle.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 19:31:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/search-for-the-node-just-created-java/m-p/19281#M8525</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-03-23T19:31:14Z</dc:date>
    </item>
  </channel>
</rss>

