class IndexAnalysisSettingsAccessor {

    /**
     * The {@link QueryBuilder}-normalized value for UUID 58859C75-F941-42E5-8D1A-FAF71DDEBBA7.
     */
    static final String INDEX_ANALYSIS_SETTINGS_OBJUID = "uthuslvotkgltggqqjmurqojpjpjjkutkujktnkk";

    private static final int INDEX_ANALYSIS_SETTINGS_OBJVER = 3;

    /**
     * Searches for a document with a {@link QueryBuilder#OBJUID} value matching
     * {@link #INDEX_ANALYSIS_SETTINGS_OBJUID}. The first document found is
     * returned, so this should not be called with a MultiReader.
     * @param reader a defined instance
     * @return a defined instance or {@code null} if none could be found
     * @throws IOException if I/O error occurs while searching Lucene
     */
    public IndexAnalysisSettings3 read(IndexReader reader) throws IOException {
        IndexAnalysisSettings3[] res = read(reader, 1);
        return res.length > 0 ? res[0] : null;
    }

    /**
     * Searches for documents with a {@link QueryBuilder#OBJUID} value matching
     * {@link #INDEX_ANALYSIS_SETTINGS_OBJUID}.
     * @param reader a defined instance
     * @param n a limit to the number of documents returned. The method may
     * return less.
     * @return a defined instance, which is empty if none could be found
     * @throws IOException if I/O error occurs while searching Lucene
     */
    public IndexAnalysisSettings3[] read(IndexReader reader, int n) throws IOException {<FILL_FUNCTION_BODY>}

    /**
     * Writes a document to contain the serialized version of {@code settings},
     * with a {@link QueryBuilder#OBJUID} value set to
     * {@link #INDEX_ANALYSIS_SETTINGS_OBJUID}. An existing version of the
     * document is first deleted.
     * @param writer a defined, target instance
     * @param settings a defined instance
     * @throws IOException if I/O error occurs while writing Lucene
     */
    public void write(IndexWriter writer, IndexAnalysisSettings3 settings)
            throws IOException {
        byte[] objser = settings.serialize();

        writer.deleteDocuments(new Term(QueryBuilder.OBJUID,
            INDEX_ANALYSIS_SETTINGS_OBJUID));

        Document doc = new Document();
        StringField uidfield = new StringField(QueryBuilder.OBJUID,
            INDEX_ANALYSIS_SETTINGS_OBJUID, Field.Store.NO);
        doc.add(uidfield);
        doc.add(new StoredField(QueryBuilder.OBJSER, objser));
        doc.add(new StoredField(QueryBuilder.OBJVER,
            INDEX_ANALYSIS_SETTINGS_OBJVER));
        writer.addDocument(doc);
    }

    private int readObjectVersion(Document doc) {
        IndexableField objver = doc.getField(QueryBuilder.OBJVER);
        return objver == null ? 1 : objver.numericValue().intValue();
    }
}


        IndexSearcher searcher = RuntimeEnvironment.getInstance().getIndexSearcherFactory().newSearcher(reader);
        Query q;
        try {
            q = new QueryParser(QueryBuilder.OBJUID, new CompatibleAnalyser()).
                parse(INDEX_ANALYSIS_SETTINGS_OBJUID);
        } catch (ParseException ex) {
            // This is not expected, so translate to RuntimeException.
            throw new RuntimeException(ex);
        }
        TopDocs top = searcher.search(q, n);

        int nres = top.totalHits.value > n ? n : (int) top.totalHits.value;
        IndexAnalysisSettings3[] res = new IndexAnalysisSettings3[nres];

        IndexAnalysisSettingsUpgrader upgrader = new IndexAnalysisSettingsUpgrader();
        StoredFields storedFields = searcher.storedFields();
        for (int i = 0; i < nres; ++i) {
            Document doc = storedFields.document(top.scoreDocs[i].doc);
            IndexableField objser = doc.getField(QueryBuilder.OBJSER);
            int objver = readObjectVersion(doc);
            try {
                res[i] = objser == null ? null : upgrader.upgrade(
                        objser.binaryValue().bytes, objver);
            } catch (ClassNotFoundException ex) {
                // This is not expected, so translate to RuntimeException.
                throw new RuntimeException(ex);
            }
        }
        return res;
    
<no_super_class>