def parse_sphinx_searchindex(searchindex):
<EOL>if hasattr(searchindex, '<STR_LIT>'):<EOL><INDENT>searchindex = searchindex.decode('<STR_LIT>')<EOL><DEDENT>query = '<STR_LIT>'<EOL>pos = searchindex.find(query)<EOL>if pos < <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>sel = _select_block(searchindex[pos:], '<STR_LIT:{>', '<STR_LIT:}>')<EOL>objects = _parse_dict_recursive(sel)<EOL>query = '<STR_LIT>'<EOL>pos = searchindex.find(query)<EOL>if pos < <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>filenames = searchindex[pos + len(query) + <NUM_LIT:1>:]<EOL>filenames = filenames[:filenames.find('<STR_LIT:]>')]<EOL>filenames = [f.strip('<STR_LIT:">') for f in filenames.split('<STR_LIT:U+002C>')]<EOL>return filenames, objects<EOL>
Parse a Sphinx search index

    Parameters
    ----------
    searchindex : str
        The Sphinx search index (contents of searchindex.js)

    Returns
    -------
    filenames : list of str
        The file names parsed from the search index.
    objects : dict
        The objects parsed from the search index.