Forum Discussion

Lito's avatar
Lito
Explorer | Level 4
5 years ago

Re: search_v2 API does not work when using id

Anyway, I can not disable the "filename_and_content" option. I only want to search into filename, not content.

 

The request to search_v2:

{
    "query": "screen",
    "options": {
        "path": "id:XXXX",
        "max_results": 1000,
        "file_status": "active",
        "filename_only": true,
        "order_by": "last_modified_time"
    },
    "match_field_options": {
        "include_highlights": false
    }
}

Response:

{
    "has_more": false,
    "matches": [
        {
            "match_type": {
                ".tag": "filename_and_content"
            },
            "metadata": {
                ".tag": "metadata",
                "metadata": {
                    ".tag": "file",
                    ...
                }
            }
        },
        {
            "match_type": {
                ".tag": "filename_and_content"
            },
            "metadata": {
                ".tag": "metadata",
                "metadata": {
                    ".tag": "file",
                    ...
                }
            }
        },
        {
            "match_type": {
                ".tag": "filename_and_content"
            },
            "metadata": {
                ".tag": "metadata",
                "metadata": {
                    ".tag": "file",
                    ...
                }
            }
        }
    ]
}

Only one of the tree files has the "screen" word into name.

 

Thanks!

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Lito Thanks for the report! Would you be able to share an unredacted request and response (please do redact the access token itself of course) showing this issue so we can better investigate? Please do so by opening an API ticket if so. Thanks in advance.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Thanks! We'll look into it and follow up with you soon.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!