<?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 files Search V2 Options Path does not work? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514680#M1823</link>
    <description>&lt;P&gt;Hi, I'm using JavaScript API on Node.js, it works almost good and smooth.&lt;/P&gt;
&lt;P&gt;But I see a strange result on filesSearchV2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is like...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;const files = await dropbox.filesSearchV2({query: keyword,&lt;BR /&gt;options: {path: '/' + targetDirectory,&lt;BR /&gt;file_status: "active",&lt;BR /&gt;filename_only: true}&lt;BR /&gt;})&lt;BR /&gt;.then(response =&amp;gt; {&lt;/P&gt;
&lt;P&gt;const metadataFiles = response.result.matches.filter(x =&amp;gt; x.metadata.metadata['.tag'] == 'file');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Here is Strange Point.&amp;nbsp; I set 'path' but this code picks other path's files.&amp;nbsp; But it's not same as Root.&lt;/P&gt;
&lt;P&gt;// I have to check path myself.&lt;BR /&gt;const regex = new RegExp(targetDirectory);&lt;BR /&gt;const pathFilteredFiles = metadataFiles.filter(x =&amp;gt; regex.test(x.metadata.metadata.path_display) == true);&lt;/P&gt;
&lt;P&gt;if (pathFilteredFiles)&lt;BR /&gt;{&lt;BR /&gt;return pathFilteredFiles.map(x =&amp;gt; x.metadata.metadata)&lt;BR /&gt;} else {&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;.catch(error =&amp;gt; {&lt;BR /&gt;console.error(error);&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I expect searchV2 is focus defined Path.&lt;/P&gt;
&lt;P&gt;I referenced following example,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-search" target="_blank" rel="noopener"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-search&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do I mistake something?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Apr 2021 11:55:33 GMT</pubDate>
    <dc:creator>yatch999</dc:creator>
    <dc:date>2021-04-20T11:55:33Z</dc:date>
    <item>
      <title>files Search V2 Options Path does not work?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514680#M1823</link>
      <description>&lt;P&gt;Hi, I'm using JavaScript API on Node.js, it works almost good and smooth.&lt;/P&gt;
&lt;P&gt;But I see a strange result on filesSearchV2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code is like...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;const files = await dropbox.filesSearchV2({query: keyword,&lt;BR /&gt;options: {path: '/' + targetDirectory,&lt;BR /&gt;file_status: "active",&lt;BR /&gt;filename_only: true}&lt;BR /&gt;})&lt;BR /&gt;.then(response =&amp;gt; {&lt;/P&gt;
&lt;P&gt;const metadataFiles = response.result.matches.filter(x =&amp;gt; x.metadata.metadata['.tag'] == 'file');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Here is Strange Point.&amp;nbsp; I set 'path' but this code picks other path's files.&amp;nbsp; But it's not same as Root.&lt;/P&gt;
&lt;P&gt;// I have to check path myself.&lt;BR /&gt;const regex = new RegExp(targetDirectory);&lt;BR /&gt;const pathFilteredFiles = metadataFiles.filter(x =&amp;gt; regex.test(x.metadata.metadata.path_display) == true);&lt;/P&gt;
&lt;P&gt;if (pathFilteredFiles)&lt;BR /&gt;{&lt;BR /&gt;return pathFilteredFiles.map(x =&amp;gt; x.metadata.metadata)&lt;BR /&gt;} else {&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;.catch(error =&amp;gt; {&lt;BR /&gt;console.error(error);&lt;BR /&gt;});&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I expect searchV2 is focus defined Path.&lt;/P&gt;
&lt;P&gt;I referenced following example,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-search" target="_blank" rel="noopener"&gt;https://www.dropbox.com/developers/documentation/http/documentation#files-search&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do I mistake something?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 11:55:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514680#M1823</guid>
      <dc:creator>yatch999</dc:creator>
      <dc:date>2021-04-20T11:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: files Search V2 Options Path does not work?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514810#M1826</link>
      <description>&lt;P&gt;This can happen in some cases, as a result of the caching/indexing delay from the Dropbox search backend. That is, if you edit or move a file, you may still see search results for old versions of the file (e.g., at the original path) for some time after the change.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 15:17:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514810#M1826</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-04-20T15:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: files Search V2 Options Path does not work?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514950#M1828</link>
      <description>&lt;P&gt;Hi Greg-DB,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks fast reply, I understand 100%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are perfectly correct, I moved my files to the other path, where was picked up by SeachV2 API, also other my duplicated (for testing) files were ignored.&amp;nbsp; It looked strange, but your information explained all these cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I improve my code with your advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 04:55:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/514950#M1828</guid>
      <dc:creator>yatch999</dc:creator>
      <dc:date>2021-04-21T04:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: files Search V2 Options Path does not work?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/564490#M2292</link>
      <description>&lt;P&gt;But for how long? Multiple hours? I am experiencing this for a LOOOOOONG time now....&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 05:46:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/564490#M2292</guid>
      <dc:creator>myfutcard</dc:creator>
      <dc:date>2021-12-16T05:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: files Search V2 Options Path does not work?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/564605#M2295</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1502073"&gt;@myfutcard&lt;/a&gt; The length of the delay depends on a number of different factors, and so can vary over time, as well as across accounts, folders, etc. While in many cases it will not take hours, in some cases it may.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 18:24:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/files-Search-V2-Options-Path-does-not-work/m-p/564605#M2295</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-12-16T18:24:42Z</dc:date>
    </item>
  </channel>
</rss>

