@Test
public void testFulltextIndexForOneField() throws Exception {

    IObject options = new DSObject("{ " +
            "\"fulltext\": \"text\"," +
            "\"language\": \"russian\"" +
            "}");
    IndexCreators.writeIndexes(body, collection, options);
    assertEquals("CREATE INDEX ON test_collection USING GIN (fulltext);\n" +
                    "CREATE FUNCTION test_collection_fulltext_update_trigger() RETURNS trigger AS $$\n" +
                    "begin\n" +
                    "new.fulltext := " +
                    "to_tsvector('russian', coalesce((new.document#>'{text}')::text,''));\n" +
                    "return new;\n" +
                    "end\n" +
                    "$$ LANGUAGE plpgsql;\n" +
                    "CREATE TRIGGER test_collection_fulltext_update_trigger BEFORE INSERT OR UPDATE " +
                    "ON test_collection FOR EACH ROW EXECUTE PROCEDURE " +
                    "test_collection_fulltext_update_trigger();\n",
            body.toString());
}