Custom Knowledge Base Module for 1C-Bitrix: Versioning & Search

Custom Knowledge Base Module for 1C-Bitrix: Versioning & Search ## When Info Blocks Fail to Handle Documentation A knowledge base often grows out of chaos: info blocks with dozens of fields, lost versions, search that can't find anything useful. Employees spend up to 30% of their work time sea

Our competencies:

Frequently Asked Questions

Custom Knowledge Base Module for 1C-Bitrix: Versioning & Search

When Info Blocks Fail to Handle Documentation

A knowledge base often grows out of chaos: info blocks with dozens of fields, lost versions, search that can't find anything useful. Employees spend up to 30% of their work time searching for information — that's a direct loss. A company recently approached us: 5,000 articles in info blocks, search via LIKE took 30 seconds, versions were not stored, and access was limited to administrators. After deploying the module, search time dropped to 0.2 seconds, and employees now publish articles themselves with change control. The rate of unsatisfactory search results decreased by 60%. Another client faced a problem: when integrating with 1C via CommerceML, data updated only once a day, and staff worked with outdated instructions. After migrating to a specialized module, synchronization became near-instant, and time spent searching for information was cut by an additional 40%. When your site has hundreds of instructions and employees spend hours searching, it's a clear signal: you need a module with versioning, full-text search, and access control. We have been doing Bitrix development for over 10 years and guarantee the quality of every module. In this article, we'll explain how the module works inside and show real numbers. Contact us for a cost and timeline estimate.

What Problems Does a Specialized Knowledge Base Module Solve?

Standard info blocks lack:

  • change history — you can't roll back to a previous version;
  • full-text search — LIKE search is slow and inaccurate;
  • access control — it's difficult to hide sections from unauthorized users;
  • support integration — a client cannot create a ticket directly from an article.

The Vendor.KnowledgeBase module solves all of this. Here's how it works.

How We Build the Module: Stack and Architecture

The module is built on Bitrix ORM (tables b_vendor_kb_*) using PostgreSQL for full-text search. It also supports integration with 1C via CommerceML for synchronizing articles with the accounting system. Stack: PHP 8.1, Bitrix ORM, PostgreSQL 15, Redis for caching. More about Bitrix ORM in the official documentation.

Data model:

  • b_vendor_kb_section — sections: id, parent_id, name, slug, description, sort, icon, access_level (public/registered/group), is_active
  • b_vendor_kb_article — articles: id, section_id, title, slug, body (HTML/Markdown), excerpt, author_id, status (draft/review/published), views, helpful_count, not_helpful_count, created_at, updated_at, published_at
  • b_vendor_kb_revision — article versions: id, article_id, body, author_id, created_at, change_summary
  • b_vendor_kb_attachment — files: id, article_id, file_id, name
  • b_vendor_kb_tag and b_vendor_kb_article_tag — tags

How is Article Versioning Organized?

Each save creates a new revision. The service code is in PHP 8.1+:

class ArticleService { public function update(int $articleId, array $fields, int $editorId, string $changeSummary = ''): void { $current = ArticleTable::getById($articleId)->fetch(); RevisionTable::add([ 'ARTICLE_ID' => $articleId, 'BODY' => $current['BODY'], 'AUTHOR_ID' => $editorId, 'CHANGE_SUMMARY' => $changeSummary ?: 'Update', 'CREATED_AT' => new DateTime(), ]); ArticleTable::update($articleId, array_merge($fields, [ 'UPDATED_AT' => new DateTime(), ])); } public function rollback(int $articleId, int $revisionId): void { $revision = RevisionTable::getById($revisionId)->fetch(); $this->update($articleId, ['BODY' => $revision['BODY']], 0, 'Rollback to revision #' . $revisionId); } } 

Revision history is stored indefinitely. To save space, old revisions can be archived by an agent (keep N latest + monthly snapshots). More about versioning: Wikipedia: Software versioning.

How Does Full-Text Search Work with PostgreSQL?

Search across article titles and bodies is built on tsvector vectors. PostgreSQL tsvector is 3 times faster than a regular LIKE search on 10,000 articles. More about the technology: Full-text search on Wikipedia. Example SQL:

UPDATE b_vendor_kb_article SET fts_vector = to_tsvector('russian', title || ' ' || strip_tags(body)) WHERE id = :id; SELECT id, title, ts_headline('russian', body, q) AS excerpt FROM b_vendor_kb_article, to_tsquery('russian', :query) q WHERE fts_vector @@ q AND status = 'published' ORDER BY ts_rank(fts_vector, q) DESC LIMIT 20; 

The result includes highlighted matches and ranking. The tsvector is built on article save using a database trigger, and an async agent updates the index once per minute. Search across 10,000 articles takes less than 0.1 seconds.

What Does Access Control Provide?

Each section has an access level:

  • public — for everyone.
  • registered — only for authenticated users.
  • group — only for users in specified Bitrix groups.

Inheritance works on the principle: if a parent section is hidden, all child sections automatically get the same level. The check is performed in the component's middleware. This ensures that confidential documents are not exposed to unauthorized persons.

Print Version and PDF

The vendor:kb.article.print component renders a navigation-free page optimized for printing. PDF is generated via mPDF, cached in the file system, and invalidated when the article is updated.

Module Development Process

Checklist of stages:

  1. Requirements analysis and access scheme design.
  2. Design of ORM tables.
  3. Implementation of the service layer (versioning, search).
  4. Development of the administrative interface.
  5. Creation of website components.
  6. Integration with the ticket system (optional).
  7. Testing on real data.
  8. Deployment and training.

What's Included: Deliverables

Stage Result
Design Database schema, API, component structure
Development Completed module with ORM, migrations, agents
Administrative interface Manage sections, articles, revisions
Website components List, article, search, print
Ticket system integration "Open ticket" button in the article
Documentation Module description, admin guide
Training 2-hour online demonstration for your staff
Technical support 3 months after launch

Comparison of Custom KB vs Ready-Made Solutions

Criterion Custom Module SaaS Solutions (Confluence, HelpDesk)
Integration with 1C-Bitrix Full Partial or via API
Access control per Bitrix groups Yes No
Versioning Full Limited
Customization Unlimited Limited by vendor

A custom module provides seamless integration and flexibility—this pays off at scale with thousands of articles. In a test catalog of 10,000 articles, the module showed 3 times lower search latency compared to an info block solution. The project pays for itself in 6–12 months.

Estimated Timelines

Stage Duration
ORM tables, section hierarchy 1 day
Article versioning, rollback 2 days
Full-text search (PostgreSQL tsvector) 2 days
Access control 1 day
Print version, PDF 1 day
Website components (list, article, search) 2 days
Administrative interface 2 days
Testing 1 day
Total 12 working days
Ticket system integration +1 day

The cost is calculated individually based on complexity. Request a consultation—we'll implement your knowledge base within 2 weeks.