Search code examples
csvannotationsgoogle-custom-search

How load annotations.tsv file to Google Custom Search Engine?


Trying to upload an annotations.tsv file to CSE, the upload dialogue says "File uploading is not successful". That's all. There's no specific error and no apparent cause. Everything looks fine.

The file is called: annotations.tsv

It has headers on the first line: URL<tab>Label<tab>Score

The file includes lines of the form: *somedomain.com/*<tab>_cse_etc<tab>1

And: someotherdomain/*<tab>_cse_etc<1>

What could possibly be wrong?


Solution

  • The problem was that one of the url patterns was invalid.

    Google CSE does not give explicit error messages. If the file's list of patterns contains any that are invalid, it just rejects the whole file. If there are any other problems with the file, it just rejects the whole file.

    The invalid pattern was of the form *.domainName.*

    Whereas these are valid patterns:

    www.domainName.com/    
    www.domainName.com/*
    subdomainName.domainName.com/dirName/*
    *.domainName.com/*
    

    This is not valid: *.domainName.*